Oracle Deadlock resolution frequent usage (tried and lost)

Source: Internet
Author: User

--1. querying for locked cases

Select object_name,machine,s.sid,s.serial#

From V$locked_object l,dba_objects O, v$session s

where l.object_id = o.object_id and L.session_id=s.sid;

--2. use the following statement Kill the process of losing a deadlock

alter system kill session ' 24,111 ';--( 24,111 Each of them is the sid,serial# of the above query )

--3. assuming the above Kill not off , the query OS level thread

Select spid, Osuser, S.program

From V$session s,v$process p

where S.paddr=p.addr and s.sid=24 --24 is above The Sid

-- Span style= "font-family: Arial" >4. os level delete thread    

   --1) unix on with root identity Run command :

#kill - 9 12345 (the SPID that was queried in step 3) )

--2 ) in Windows(Unix also applies) with Orakill To Kill a thread,orakill is A running command provided by Oracle with the following syntax:

orakill SID thread

  -- among them:

--sid : Indicates the name of the instance to which the process to kill belongs

--thread : Is the thread number to be killed, which is the spid queried in step 3 .

Oracle Deadlock resolution frequent usage (tried and lost)

Related Article

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.