/

select
b.id1,
a.sid,
a.serial#,
b.type,
to_char(b.ctime / 60,'999999999.9') min,
decode(b.lmode,
1, 'NULL',
2, '行共有(SS)',
3, '行排他(SX)',
4, '共有(S)',
5, '共有行排他(SRX)',
6, '排他(X)',
'???') lmode,
decode(b.request,
1, 'NULL',
2, '行共有(SS)',
3, '行排他(SX)',
4, '共有(S)',
5, '共有行排他(SRX)',
6, '排他(X)',
'???') request
from v$session a, v$lock b
where a.sid = b.sid and
(b.id1, b.id2) in (
select d.id1,d.id2 from v$lock d
where
d.id1 = b.id1 and d.id2 = b.id2 and
d.request > 0
)
order by b.id1, b.ctime desc;