Willpower88
Method One: Oracle deadlock is very frustrating, summed up some of the experience as learning notes
1. Check which process is locked
Check V$db_object_cache view:
SELECT * from V$db_object_cache WHERE owner= ' The owning user ' and locks!= ' 0 ';
2. Check which SID, through the SID can know which session.
Check v$access view:
SELECT * from v$access WHERE owner= ' The owning user ' and Name= ' the process name ' just found ';
3. Identify SIDs and serial#
Check v$session view:
SELECT sid,serial#,paddr from v$session WHERE sid= ' SID just found '
Check v$process view:
SELECT the SPID from v$process WHERE addr= ' just found paddr ';
4. Killing process
(1). Kill the Oracle Process first:
ALTER SYSTEM KILL Session ' detected SID, detected serial# ';
(2). Then kill the operating system process:
KILL-9 just identified the SPID.
Or
Orakill just identified the SPID that SID just identified.
Method Two:
This problem is often encountered during Oracle's use, so a few solutions are summarized:
1 Find the process of deadlock:
Sqlplus "/as sysdba"
SELECT S.username,l.object_id,l.session_id,s.serial#,l.oracle_username,l.os_user_name,l.pro
CESS from V$locked_object l,v$session S WHERE l.session_id=s.sid;
2 Kill the process of the deadlock:
Alter system kill session ' sid,serial# '; (of which sid=l.session_id)
3) If it is not resolved,
Select Pro.spid from V$session ses,v$process Pro where ses.sid=xx and ses.paddr=pro.addr;
Where the SID replaces the SID with the deadlock.
Exit
Ps-ef|grep spid
Where the SPID is the process number of the process, kill the Oracle process.