SELECT '||' '' || M.SID || ',' || sn.serial # || '' '||'; 'From v $ session SN, V $ LOCK Mwhere Sn.SID = m.sidand m.Request = 0 and LMODE! = 4 and (id1, ID2) in (Select S.ID1, S.ID2 from V $ LOCK S Where Request! = 0 and S.ID1 = m. ID1 and S.ID2 = m.id2);