--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