Displays SQL Statement for the Specified Address or Hash
--
-- Displays the SQL statement held at the specified address or hash.
--
 
SET PAUSE ON
SET PAUSE 'Press Return to Continue'
SET PAGESIZE 60
SET LINESIZE 300
 
COLUMN sql_text FORMAT A64
 
SELECT a.sql_text,a.address,a.hash_value
FROM   v$sqltext_with_newlines a
WHERE  a.address = UPPER('&Address_Or_Return') 
OR     a.hash_value = UPPER('&Hash_Or_Return')
ORDER BY a.piece
/

Related Scripts

Get Historical Plans from the AWR Using SQLID
List Distinct SQL ID's for a Given Session
List SQL Run Dates for a Given Plan Hash Value

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License