Oracle finds the SQL statement that causes the wait according to v $ wait_chains
Oracle finds the SQL statement that causes the wait according to v $ wait_chains
Functions of several views, from official documents
V $ sqltext
V $ SQLTEXTDisplays the text of SQL statements belonging to shared SQL cursors in the SGA.
V $ SESSION
V $ SESSIONDisplays session information for each current session.
V $ wait_chains
V $ WAIT_CHAINSDisplays information about blocked sessions. A wait chain is comprised of sessions that are blocked by one another. each row represents a blocked and blocker session pair. if a wait chain is not a valid ical wait chain, then the last row for the chain does not have a blocker.
Locate the SQL statement that causes the wait
Select * from v $ sqltext
Where
(Hash_value, address) in
(
Select decode (SQL _hash_value, 0, prev_hash_value, SQL _hash_value ),
DECODE (SQL _hash_value, 0, prev_ SQL _addr, SQL _address)
FROM v $ session
Where sid in (select sid from v $ wait_chains)
);
,