#查看现在系统中用户拥有的锁。
Select scott,v$lock.sid,trunc(id1/power(2,16)) rbs,bitand(id1,to_number('ffff','xxxx'))+0 slot,id2 seq,lmode,request,v$lock.type
from v$lock,v$session
where v$lock.sid=v$session.sid and v$session.username='&S';
#查看现在系统中正在处理的事务。
Select XIDUSN,XIDSLOT,XIDSQN from v$transaction;
#查看谁阻塞了谁
Select (select username from v$session where sid=a.sid) blocker, a.sid,
' is blocking ',
(select username from v$session where sid=a.sid) 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;