Note
This view is introduced in V4.2.0.
Purpose
This view displays the lock or lock request status of each table for the current user.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | VARCHAR2(46) | NO | The IP address of the OBServer node that holds or requests the lock. |
| SVR_PORT | NUMBER(38) | NO | The port number of the OBServer node that holds or requests the lock. |
| TENANT_ID | NUMBER(38) | NO | The ID of the tenant that holds or requests the lock. |
| TRANS_ID | NUMBER(38) | NO | The transaction ID of the transaction that holds or requests the lock. |
| SESSION_ID | NUMBER(38) | NO | The session ID of the session that holds or requests the lock.
|
| TYPE | VARCHAR2(9) | NO | The type of the lock. Valid values:
|
| ID1 | NUMBER | NO | Identifier 1 of the lock.
|
| ID2 | VARCHAR2(553) | NO | Identifier 2 of the lock.
|
| ID3 | varchar(512) | NO | Identifier 3 of the lock.
Note
|
| LMODE | VARCHAR2(8) | NO | The mode in which the current lock is held.
|
| REQUEST | VARCHAR2(8) | NO | The mode in which the current lock is requested.
|
| CTIME | NUMBER(38) | NO | The time when the lock was obtained or the wait time for the lock, in microseconds. |
| BLOCK | NUMBER | NO | Indicates whether the lock requested by the current transaction is held by another transaction.
|
Sample query
Check the lock status of each table for the current user on the current OBServer node.
obclient [SYS]> SELECT * FROM SYS.V$OB_LOCKS;
The query result is as follows:
+----------------+----------+-----------+----------+------------+------+---------+------------+--------+-------+---------+-----------+-------+
| SVR_IP | SVR_PORT | TENANT_ID | TRANS_ID | SESSION_ID | TYPE | ID1 | ID2 | ID3 | LMODE | REQUEST | CTIME | BLOCK |
+----------------+----------+-----------+----------+------------+------+---------+------------+--------+-------+---------+-----------+-------+
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 500084 | X | NONE | 343458403 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200069 | X | NONE | 343441113 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200068 | X | NONE | 343441120 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200067 | X | NONE | 343441128 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200066 | X | NONE | 343441135 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200065 | X | NONE | 343441144 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200064 | X | NONE | 343441152 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200063 | X | NONE | 343441159 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200062 | X | NONE | 343441187 | 0 |
| 11.xxx.xxx.xxx | 28825 | 1004 | 3966849 | 3221605368 | TM | 3966849 | 3221605368 | 200061 | X | NONE | 343441200 | 0 |
+----------------+----------+-----------+----------+------------+------+---------+------------+--------+-------+---------+-----------+-------+
10 rows in set
References
For more information about table locks, see Lock a table.