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 s.username,l.OBJECT_ID,l.SESSION_ID,s.SERIAL#,
l.ORACLE_USERNAME,l.OS_USER_NAME,l.PROCESS
FROM V$LOCKED_OBJECT l,V$SESSION S WHERE l.SESSION_ID=S.SID;
查询到死锁的session_id, serial#
alter system kill session 'sid,serial#'; (其中sid=l.session_id)
杀死死锁的进程
最新内容请见作者的GitHub页:http://qaseven.github.io/
时间: 2024-10-22 20:20:38