- 通过oracle动态视图查看哪些对象正在并发访问,同时谁正在持有资源以及谁在等待它。
SELECT S1.USERNAME BLKG_USER,
S1.MACHINE BLKG_MACHINE,
S1.SID BLKG_SID,
S2.USERNAME WAIT_USER,
S2.MACHINE WAIT_MACHINE,
S2.SID WAIT_SID,
LO.OBJECT_ID BLKG_OBJ_ID,
DO.OWNER,
DO.OBJECT_NAME
FROM V$LOCK L1,
V$SESSION S1,
V$LOCK L2,
V$SESSION S2,
V$LOCKED_OBJECT LO,
DBA_OBJECTS DO
WHERE S1.SID = L1.SID
AND S2.SID = L2.SID
AND L1.ID1 = L2.ID1
AND S1.SID = LO.SESSION_ID
AND LO.OBJECT_ID = DO.OBJECT_ID
AND L1.BLOCK = 1
AND L2.REQUEST > 0;
- 释放锁资源
ALTER SYSTEM KILL SESSION ',' IMMEDIATE;
标签:DO,S2,S1,OBJECT,SID,oracle,ID
From: https://www.cnblogs.com/aq0321/p/17841068.html