1 SELECT /*+ RULE */ 2 distinct B.USERNAME, 3 A.USERNAME, 4 H.SID SESSION_ID, --需要killed 5 W.SID SESSION_ID 6 FROM V$SESSION B, V$ACCESS O, V$LOCK H, V$LOCK W, V$SESSION A 7 WHERE H.LMODE <> 0 8 AND H.LMODE <> 1 9 AND W.REQUEST <> 0 10 AND H.TYPE = W.TYPE 11 AND H.ID1 = W.ID1 12 AND H.ID2 = W.ID2 13 AND B.SID = H.SID 14 AND W.SID = A.SID 15 AND (O.SID = W.SID OR O.SID = H.SID) 16 AND O.OWNER <> 'SYS';