Note
This view is introduced in V4.2.0.
Purpose
This view displays the locks held or requested by the current user.
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 number 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 that holds or requests the lock.
|
| TYPE | varchar(9) | NO | The lock type. Valid values include:
|
| ID1 | bigint(20) | NO | The first lock identifier. Valid values include:
|
| ID2 | varchar(533) | NO | The second lock identifier. Valid values include:
|
| ID3 | varchar(512) | NO | The third lock identifier. Valid values include
Note
|
| LMODE | varchar(8) | NO | The lock mode held by the transaction. Valid values include:
|
| REQUEST | varchar(8) | NO | The lock mode requested by the transaction. Valid values include:
|
| CTIME | bigint(20) | NO | The time in microseconds when the transaction holds or waits for a lock. |
| 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 for each table of the current user.
obclient [oceanbase]> SELECT * FROM oceanbase.V$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-compatible mode) and Lock a table (Oracle-compatible mode).