Description
transaction_read_only specifies whether to enable just read-only transactions.
Privilege requirements
Query variables
Global level
Both the
systenant and all user tenants can view the values of Global variables by using theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLE(Oracle mode) orinformation_schema.GLOBAL_VARIABLES(MySQL mode) view.Session level
In Oracle mode, you can use the
SHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview to query session system variables in thesysand user tenants. In MySQL mode, you can use theSHOW VARIABLESstatement or theinformation_schema.SESSION_VARIABLESview.
Modify variables
Global level
The
systenant can modify the values of Global system variables.MySQL user tenants need to have the
SUPERorALTER SYSTEMprivilege to modify the values of global system variables.In V4.x, starting with V4.2.0, you must grant the
ALTER SYSTEMprivilege to an Oracle user tenant so that the tenant can modify the values of global system variables.
Session level
Users of the
sysand all user tenants can directly modify the session system variables of their own tenants.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Boolean |
| Default value | False |
| Value |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Description
When the transaction_read_only variable is set to True, DML statements cannot be executed.
Examples
Set to TRUE to allow nonread-only transactions.
Session level
obclient> SET transaction_read_only = False;Global level
obclient> SET GLOBAL transaction_read_only = False;