Note
This variable was introduced in OceanBase Database V2.2.77.
Description
The ob_trx_lock_timeout variable specifies the timeout duration for waiting for a lock in a transaction.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or viewSYS.TENANT_VIRTUAL_GLOBAL_VARIABLE(Oracle mode) andinformation_schema.GLOBAL_VARIABLES(MySQL mode) to query the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or viewSYS.TENANT_VIRTUAL_SESSION_VARIABLE(Oracle mode) andinformation_schema.SESSION_VARIABLES(MySQL mode) to query the value of a session system variable.
Modify variables
Set the variable at the global level
The
systenant can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Set the variable at the session level
The
systenant and all user tenants can directly modify the value of a session system variable in their own tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | int |
| Default value | -1, which indicates that the value is not in effect and the unit is microseconds. |
| Value range | [0,+∞)
NoteIf the value is 0, it indicates NO WAIT. |
| Scope | |
| Modifiable | Yes. The value can be modified by using the SET statement. |
Examples
Set the variable at the session level
obclient> SET ob_trx_lock_timeout = 3000;Set the variable at the global level
obclient> SET GLOBAL ob_trx_lock_timeout = 3000;