标签:
问题:更新的Update语句一直在更新 卡在执行update语句的地方。
清除的方法:
Oracle表死锁解除
select a.owner, a.object_name, b.xidusn, b.xidslot, b.xidsqn, b.session_id, b.oracle_username, b.os_user_name, b.process, b.locked_mode, c.machine, c.status, c.server, c.sid, c.serial#, c.program from all_objects a, v$locked_object b, sys.gv_$session c where (a.object_id = b.object_id) and (b.process = c.process) order by 1, 2
---------------------------------------------
第一步:查看是否有死锁存在,查出有数据则代表有死锁:
select p.spid,c.object_name,b.session_id,b.oracle_username,b.os_user_name 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
SELECT sid, serial#, username, osuser FROM v$session where sid=‘第一步查询出来的session_id‘;
第三步:删除死锁【第一个参数为sid,第二个为serial#】
alter system kill session ‘sid,serial#‘;
select pro.spid from v$session ses,v$process pro where ses.sid=XX and ses.paddr=pro.addr;
其中sid用死锁的sid替换。
1.exit 2.ps -ef|grep spid
---------------------------------------------
其中spid是这个进程的进程号,kill掉这个Oracle进程。
-------------------------------------------------分割线
select p.spid,c.object_name,b.session_id,b.oracle_username,b.os_user_name 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
SELECT sid, serial#, username, osuser FROM v$session where sid=‘1250‘;--根据上面的Session_id查询到 serial# alter system kill session ‘1250,29967‘---1250就是上面的sid,29967就是上面的serial#
标签:
原文地址:http://www.cnblogs.com/wangjunwei/p/4472298.html