Note
This view is introduced in V4.2.0.
Purpose
This view displays the lock or lock request information of the current user for each table.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node that holds or requests a lock. |
| SVR_PORT | bigint(20) | NO | The port of the OBServer node that holds or requests a lock. |
| TENANT_ID | bigint(20) | NO | The ID of the tenant that holds or requests a lock. |
| TRANS_ID | bigint(20) | NO | The ID of the transaction that holds or requests a lock. |
| SESSION_ID | bigint(20) | NO | The session ID holding or requesting the lock.
|
| TYPE | varchar(9) | NO | The type of the lock. Valid values include:
|
| ID1 | bigint(20) | NO | The value of the first lock identifier. Valid values include:
|
| ID2 | varchar(533) | NO | The value of the second lock identifier. Valid values include:
|
| ID3 | varchar(512) | NO | The third lock identifier.
Note
|
| LMODE | varchar(4) | NO | The mode of the lock held by the transaction. Valid values include:
|
| REQUEST | varchar(8) | NO | The mode of the lock requested by the transaction. Valid values include:
|
| CTIME | bigint(20) | NO | The time when the transaction holds or waits for a lock, in microseconds. |
| BLOCK | bigint(1) | NO | Indicates whether the lock requested by the transaction is held by another transaction. Valid values include:
|
Sample query
Query the lock holding or requesting status of each table for the current user.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_LOCKS LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
SVR_IP: xx.xx.xx.xx
SVR_PORT: 2882
TENANT_ID: 1003
TRANS_ID: 7414198
SESSION_ID: 3221619563
TYPE: TX
ID1: 7414198
ID2: 3221619563
ID3: NULL
LMODE: X
REQUEST: NONE
CTIME: 11162
BLOCK: 0
References
For more information about table locks, see Lock a table (MySQL mode) and Lock a table (Oracle mode).