3,491
社区成员
发帖
与我相关
我的任务
分享
--查等待进程
select * from gv$lock where request > 0 ;
--查持有锁进程
select a.inst_id, a.sid, b.ctime,b.id1, a.sql_id,
'alter system kill session ''' || a.sid || ',' || serial# || ''';' kill,
a.*, b.*
from gv$session a, gv$lock b
where a.inst_id = b.inst_id
and a.sid = b.sid
and b.id1 in (select id1 from gv$lock where request > 0)
and b.lmode > 0
order by a.inst_id, a.sid;