oracle 检查被锁的表及解锁

转载 oracle 检查被锁的表及解锁 收藏

处理方法一 :

检查那个表被锁
select sess.sid,sess.serial#, lo.oracle_username,lo.os_user_name,ao.object_name,lo.locked_mode
from v$locked_object lo,dba_objects ao,v$session sess
where ao.object_id = lo.object_id
and lo.session_id = sess.sid;

解锁

alter system kill session ‘273,45’;

处理方法二 :

找到你要杀掉的那个SESSION, 并记下paddr

SELECT sid, username, paddr, status FROM v$session WHERE username = ‘JCUSER’ and sid=上面查出来的sid;

找到这个SESSION所对应的spid

SELECT ADDR,PID,SPID,USERNAME,SERIAL#,TERMINAL FROM v$process WHERE addr = ‘上面的PADDR’;

杀掉spid所标识的那个进程

orakill sid spid

原文来源:http://tech.e800.com.cn/articles/2009/710/1247207067745_1.html

Leave a Reply

Your email address will not be published. Required fields are marked *