Note
This view is available starting with V4.2.0.
Purpose
This view displays the lock status of tables for the current user on the current OBServer node.
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 ID of the transaction that holds or requests the lock. |
| SESSION_ID | NUMBER(38) | NO | The ID of the session that holds or requests the lock.
|
| TYPE | VARCHAR2(9) | NO | The lock type:
|
| ID1 | NUMBER | NO | Lock identifier 1:
|
| ID2 | VARCHAR2(553) | NO | Lock identifier 2:
|
| ID3 | varchar(512) | NO | Lock identifier 3:
Note
|
| LMODE | VARCHAR2(8) | NO | The mode in which the lock is currently held:
|
| REQUEST | VARCHAR2(8) | NO | The mode in which the lock is currently requested:
|
| CTIME | NUMBER(38) | NO | The time for which the lock is held or the time for which the lock is being waited for, in microseconds. |
| BLOCK | NUMBER | NO | Indicates whether the lock requested by the current transaction is held by another transaction:
|
Sample query
Query the locks held or requested by the current user on all tables 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.