ORACLE查询死锁以及杀死死锁

1、执行预计查询死锁,这条语句直接复制执行即可
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;
2、执行下面语句杀死对应的会话,其中sid,serial为上述语句查询的值

alter system kill session 'sid,serial';
例如:

alter system kill session '219,236';
alter system kill session '216,25421';

你可能感兴趣的:(Bug记录,开发记录,oracle,数据库)