介绍
V$LOCK视图提供了查询当前数据库中持有的锁的方法。
视图详情
字段名 | 字段类型 | 描述 | 译 | 备注 |
ADDR | RAW(4 | 8) | Address of lock state object | 锁定对象的地址 | |
KADDR | RAW(4 | 8) | Address of lock | 锁地址 | |
SID | NUMBER | Identifier for session holding or acquiring the lock | 持有或获取锁的会话标识符 | |
TYPE | VARCHAR2(2) | Type of user or system lock The locks on the user types are obtained by user applications. Any process that is blocking others is likely to be holding one of these locks. The user type locks are: TM - DML enqueue TX - Transaction enqueue UL - User supplied | 用户或系统锁定的类型: TM - DML队列 TX - 事务队列 UL - 用户自定 | |
ID1 | NUMBER | Lock identifier #1 (depends on type) | 锁定标识符#1 | |
ID2 | NUMBER | Lock identifier #2 (depends on type) | 锁定标识符#2 | |
LMODE | NUMBER | Lock mode in which the session holds the lock: 0 - none 1 - null (NULL) 2 - row-S (SS) 3 - row-X (SX) 4 - share (S) 5 - S/Row-X (SSX) 6 - exclusive (X) | 会话锁定的模式: 0 - none 1 - 空 2 - 行级共享锁,其他对象仅能查询这些数据 3 - 行级排它锁,提交之前不允许做DML操作 4 - 共享锁 5 - 共享级排它锁 6 - 排它锁 | |
REQUEST | NUMBER | Lock mode in which the process requests the lock: 0 - none 1 - null (NULL) 2 - row-S (SS) 3 - row-X (SX) 4 - share (S) 5 - S/Row-X (SSX) 6 - exclusive (X) | 线程锁定的模式: 0 - none 1 - 空 2 - 行级共享锁,其他对象仅能查询这些数据 3 - 行级排它锁,提交之前不允许做DML操作 4 - 共享锁 5 - 共享级排它锁 6 - 排它锁 | |
CTIME | NUMBER | Time since current mode was granted | 锁住的时间,以秒为单位 | |
BLOCK | NUMBER | Indicates whether the lock in question is blocking other processes. The possible values are: 0 - The lock is not blocking any other processes 1 - The lock is blocking other processes 2 - The lock is not blocking any blocked processes on the local node, but it may or may not be blocking processes on remote nodes. This value is used only in Oracle Real Application Clusters (Oracle RAC) configurations (not in single instance configurations). | 锁是否阻止其他线程: 0 - 锁不阻止任何其他线程 1 - 锁阻止其他线程 2 - RAC环境中会出现,锁不会阻止本地节点,但可能阻塞远程节点,也可能不阻塞远程节点 |
评论区