欢迎加入站点基地设计开发交流群:30720409
详细内容
PL/SQL查找其他用户锁表并解锁的方法
发布日期:2012-11-09     点击:3480     字体:[ ]

原理为查找锁表用户,然后注销掉即可,以下SQL很有帮助:

select * from v$locked_object


select * from v$locked_object
select * from v$session where sid = '45'
alter system kill session '45,494'

SELECT s.sid, s.serial#, s.username, s.schemaname, s.osuser, s.process, s.machine,
s.terminal, s.logon_time, l.type
FROM v$session s, v$lock l
WHERE s.sid = l.sid
AND s.username IS NOT NULL
ORDER BY sid

 

SELECT p.spid, a.serial#,a.program, c.object_name, b.session_id, b.oracle_username,
       b.os_user_name ,a.logon_time
  FROM v$process p, v$session a, v$locked_object b, all_objects c
 WHERE p.addr = a.paddr AND a.process = b.process
       AND c.object_id = b.object_id

用户评论
昵称 
内容  *
验证码   
   
相关文章 更多...  
Copyright © 2010 zdbase.com All Rights Reserved. 苏ICP备15039389号-1 可人软件设计