Oracle disconnects the user who generated the deadlock

Source: Internet
Author: User

--View disk statements that consume the most disk read and write rates


SELECT *

From (select v.sql_id,

V.child_number,

V.sql_text,

V.elapsed_time,

V.cpu_time,

V.disk_reads,

Rank () Over (order by v.disk_reads Desc) Elapsed_rank

From V$sql v) a

where Elapsed_rank <= 10;


--View the statement that generated the table lock, can be to the SID number

SELECT * from V$lock where type= ' TX ';


--view sessions, which can be disconnected based on Sid and Serial# fields

SELECT * from V$session where sid=147;

SELECT * from V$session where sid=138;


--View the machine that generated the deadlock

Select Username,sid,serial#,lockwait,status,machine,program from v$session where SID in

(select session_id from V$locked_object)


--Disconnect session

Alter system kill session ' 138,45 ';



--View the SQL statement that generated the deadlock

Select Sql_text from V$sql where Hash_value in

(select Sql_hash_value from v$session where SID in

(select session_id from V$locked_object))


This article is from the "Hou Zhiqing" blog, make sure to keep this source http://houzhiqing.blog.51cto.com/6086337/1614835

Oracle disconnects the user who generated the deadlock

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.