Showing posts with label How to identify the sql used by a session in oracle database. Show all posts
Showing posts with label How to identify the sql used by a session in oracle database. Show all posts

Friday, January 13, 2012

How to identify the sql used by a session in oracle database

select  sql.sql_text
      from   v$session ses, v$sqltext sql
      where sql.address=ses.sql_address
      and     sql.hash_value=ses.sql_hash_value
      and     sid=&session_id
      order   by piece;