/* ************************************************ */
/*                                                  */
/* fnctn:   Show what is executing in the shared    */
/*          pool area                               */
/*                                                  */
/* name:    @c:\oracle\sql\get_stmt.sql             */
/* date:    12-MAY-95                               */
/* creator: Rick Kupcunas (Oracle)                  */
/*                                                  */
/* ************************************************ */
/*********************************************************************

This script will get the statement that is executing in the
Shared Pool Area when passed the correct SID of a database
process.

*********************************************************************/

column sql_addr new_value sql_addr;
select sql_address sql_addr
from v$session
where SID = '&session_id';

select sql_text
from v$sqlarea sa
where sa.address = hextoraw('&sql_addr');
