查看锁表和解锁

查看锁表和解锁

听风知秋雨 619 2022-04-01

oracle

  • tablename被锁表名
  • unlocksql解锁语句
select o.object_name tablename,s.osuser lockby,s.username loginuser,s.sid,s.serial# serial,'alter system kill session '''||s.sid||','||s.serial#||'''; ' unlocksql
from v$locked_object l,dba_objects o ,v$session s
where l.object_id = o.object_id and l.session_id=s.sid;