Note
This view is introduced in V4.2.0.
Purpose
The V$OB_LOCKS view displays the locks held or requested on each table for the current user.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node that holds or requests the lock. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node that holds or requests the lock. |
| TENANT_ID | bigint(20) | NO | The ID of the tenant that holds or requests the lock. |
| TRANS_ID | bigint(20) | NO | The transaction ID of the transaction that holds or requests the lock. |
| SESSION_ID | bigint(20) | NO | The session ID that holds or requests a lock.
|
| TYPE | varchar(9) | NO | The type of the lock. Valid values:
|
| ID1 | bigint(20) | NO | Identifier 1 of the lock. Valid values:
|
| ID2 | varchar(533) | NO | Identifier 2 of the lock. Valid values:
|
| ID3 | varchar(512) | NO | Identifier 3 of the lock. Valid values:
Note
|
| LMODE | varchar(8) | NO | The mode in which the current transaction holds the lock. Valid values:
|
| REQUEST | varchar(8) | NO | The mode in which the current transaction requests a lock. Valid values:
|
| CTIME | bigint(20) | NO | The time when the transaction holds or waits for a lock, in microseconds. |
| BLOCK | bigint(1) | NO | Indicates whether a lock requested by the current transaction is held by another transaction. Valid values:
|
Sample query
Query the locks or lock requests on tables for 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.