码迷,mamicode.com
首页 > 数据库 > 详细

oracle 杀死被锁进程

时间:2014-05-28 02:21:13      阅读:399      评论:0      收藏:0      [点我收藏+]

标签:c   a   strong   os   name      

Oracle杀死死锁进程

先查看哪些表被锁住了:

select b.owner,b.object_name,a.session_id,a.locked_mode
from v$locked_object a,dba_objects b
where b.object_id = a.object_id;

OWNER        OBJECT_NAME        SESSION_ID LOCKED_MODE
------------------------------ -----------------
WSSB SBDA_PSHPFTDT      22 3
WSSB_RTREPOS WB_RT_SERVICE_QUEUE_TAB      24 2
WSSB_RTREPOS WB_RT_NOTIFY_QUEUE_TAB      29 2
WSSB_RTREPOS WB_RT_NOTIFY_QUEUE_TAB      39 2
WSSB SBDA_PSDBDT        47 3
WSSB_RTREPOS WB_RT_AUDIT_DETAIL        47 3

select b.username,b.sid,b.serial#,logon_time 
from v$locked_object a,v$session b
where a.session_id = b.sid order by b.logon_time;

USERNAME      SID      SERIAL# LOGON_TIME
------------------------------ ---------- -------
WSSB_RTACCESS        39        1178 2006-5-22 1
WSSB_RTACCESS        29        5497 2006-5-22 1

杀进程中的会话:
alter system kill session ‘sid,serial#‘;
e.g
alter system kill session ‘29,5497‘;

如果有ora-00031错误,则在后面加immediate;alter system kill session ‘29,5497‘ immediate;

oracle 杀死被锁进程,布布扣,bubuko.com

oracle 杀死被锁进程

标签:c   a   strong   os   name      

原文地址:http://www.cnblogs.com/Iyce/p/3753683.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!