Oracle deadlock handling

Source: Internet
Author: User

How should we solve the Oracle deadlock problem? Many people may have such questions. The following describes how to handle the Oracle deadlock for your reference.

Generally, you only need to submit the statement that generates an Oracle deadlock, but in the actual execution process. The user may not know which statement is used to generate a deadlock. You can close the program and restart it.
This problem is often encountered during the use of Oracle, so a few solutions are also summarized.

1) Find the process of Oracle deadlock:

 
 
  1. sqlplus "/as sysdba" (sys/change_on_install)  
  2. SELECT s.username,l.OBJECT_ID,l.SESSION_ID,s.SERIAL#,  
  3. l.ORACLE_USERNAME,l.OS_USER_NAME,l.PROCESS   
  4. FROM V$LOCKED_OBJECT l,V$SESSION S WHERE l.SESSION_ID=S.SID; 

2) kill the Oracle deadlock process:

 
 
  1. Alter system kill session 'sid, serial # '; sid = l. session_id)

3) if the problem persists:

 
 
  1. select pro.spid from v$session ses,  
  2. v$process pro where ses.sid=XX and   
  3. ses.paddr=pro.addr; 

Replace the sid with the sid of the deadlock:

 
 
  1. exit  
  2. ps -ef|grep spid 

Spid is the process Number of the process and kill the Oracle process.

Statement of Oracle paging Query

Oracle sqlplus statement Editing Command

Statement of Oracle cyclic statements

Oracle user syntax Modification

How to check the oracle deadlock

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.