📅  最后修改于: 2022-03-11 15:05:29.060000             🧑  作者: Mango
SELECT (SELECT USERNAME FROM v$session WHERE SID = a.SID) AS blocker,
a. SID,
' is blocking ',
(SELECT USERNAME FROM v$session WHERE SID = b. SID) AS blockee,
b. SID
FROM v$lock a,
v$lock b
WHERE a.BLOCK = 1 AND b.REQUEST > 0 AND a.ID1 = b.ID1 AND a.ID2 = b.ID2;