首页 > 代码库 > oracle 杀死被锁进程
oracle 杀死被锁进程
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;
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。