Note
This variable is available starting with V2.2.77.
Description
transaction_read_only specifies whether to allow only read-only transactions.
Privilege requirements
Query variables
Global level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle-compatible mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode) to view the values of Global system variables.Session level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle-compatible mode) or theinformation_schema.SESSION_VARIABLESview (MySQL-compatible mode) to view the values of Session system variables.
Modify variables
Global level
systenants can directly modify the values of Global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the values of Global system variables.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the values of Global system variables.
Session level
systenants and all user tenants can directly modify the values of Session system variables.
Attributes
| Attribute | Description |
|---|---|
| Type | Bool |
| Default value | False |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
When transaction_read_only is set to True, DML statements cannot be executed.
Examples
Allow non-read-only transactions.
Session level
obclient> SET transaction_read_only = False;Global level
obclient> SET GLOBAL transaction_read_only = False;