How to kill the Oracle deadlock process

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.