ITeye博客

删除oracle死锁

kingmxj · 2011-11-23 10:08 · Oracle · 数据库 · Oracle · Markdown

1:查看是否有死锁存在,查出有数据则代表有死锁
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

2:查出死锁session的精确信息【sid 为前面语句的session_id】 SELECT sid, serial#, username, osuser FROM v$session where sid='第一步查询出来的session_id';

3:删除死锁【第一个参数为sid,第二个为serial#】 alter system kill session '第一个参数,第二个参数';

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。