select INST_ID, SID, TYPE, ID1, ID2, LMODE, REQUEST, CTIME, BLOCK,
DECODE (BLOCK, 0, '', 'blocker') blocker,
DECODE (request, 0, '', 'waiter') waiter
from gv$lock where (ID1,ID2,TYPE) in
(select ID1,ID2,TYPE from gv$lock where request>0)
order by blocker;
执行结果示例如下:
INST_ID SID TYPE ID1 ID2 LMODE REQUEST CTIME BLOCK BLOCKER WAITER
------- ------- ---- ---------- ---------- ----- ------- ---------- ----- -------------- ------------
1 70 TX 65539 2630730 6 0 2520 1 blocker
1 86 TX 65539 2630730 0 4 1654 0 waiter
稍等一会输入/、回车,再次执行上面的SQL,如阻塞情况不变,则确认SID =70的会话是阻塞会话
如果结果显示no rows selected,则表示正常