1. 查询锁定的表:

SELECT l.session_id sid,
       s.serial#,
       l.locked_mode,
       l.oracle_username,
       l.os_user_name,
       s.machine,
       s.terminal,
       o.object_name,
       s.logon_time
  FROM v$locked_object l, all_objects o, v$session s
 WHERE l.object_id = o.object_id
   AND l.session_id = s.sid
 ORDER BY s.sid, s.serial#;


2. 删除锁

ALTER system KILL session '<SID>,<serial#>';


Reference:

https://docs.oracle.com/cd/B28359_01/server.111/b28310/manproc008.htm#ADMIN11192

https://oracle-base.com/articles/misc/killing-oracle-sessions


本文链接地址: Oracle 查找并删除锁
http://qingfengju.com/index.asp?id=408

分类:数据库 查看次数:1910 发布时间:2016-4-1 10:20:12