找出哪个会话锁住了哪张表:
select l.session_id,o.owner,o.object_name
from v$locked_object l,dba_objects o
where l.object_id=o.object_id;
session_id 为会话 ID。object_name 表名。
找出引发锁的会话:
select s.username,s.sid,s.serial#,s.logon_time
from v$locked_object l,v$session s
where l.session_id=s.sid
order by s.logon_time;
其中的 serial# 是我们需要用到的会话序列号