SQL Query to view sql of a session

Posted on August 25, 2008. Filed under: DBA/Admin Tips, Diagnostics, R12, RAC, Scripts, TroubleShooting | Tags: , , , , |

SELECT
T.sql_text
FROM
v$session S,
v$sqltext_with_newlines T
WHERE
S.sid = &sid
AND S.serial# = &serial
AND S.sql_address = T.address
AND S.sql_hash_value = T.hash_value
ORDER BY T.piece
/

Replace v$session with gv$session if the database is running on RAC configuration.

cheers,
Ram.

Make a Comment

Make A Comment: ( 1 so far )

blockquote and a tags work here.

One Response to “SQL Query to view sql of a session”

RSS Feed for OraclePitStop – Lets share some knowledge Comments RSS Feed

[...] here to extract the sql being executed by a concurrent [...]


Where's The Comment Form?

  • a

  • Blog Stats

    • 143,553 hits

Liked it here?
Why not try sites on the blogroll...