侧边栏壁纸
博主头像
与晚风述往事博主等级

万般皆下品,唯有读书高。

  • 累计撰写 149 篇文章
  • 累计创建 29 个标签
  • 累计收到 19 条评论

目 录CONTENT

文章目录

V$LOCK动态性能视图

与晚风述往事
2021-12-18 / 0 评论 / 0 点赞 / 357 阅读 / 1,447 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2021-12-18,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

介绍

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环境中会出现,锁不会阻止本地节点,但可能阻塞远程节点,也可能不阻塞远程节点
0

评论区