Re: Currently executing SQL statment

From: Frank Bommarito <102132.126_at_CompuServe.COM>
Date: 1995/08/31
Message-ID: <424etu$fg4$1_at_mhafn.production.compuserve.com>#1/1


rem This script identifies the current SQL Statement used rem for a given OS Process Id.
rem
select vse.process,vse.osuser,vsq.executions,vsq.sql_text

from   v$open_cursor vop,
       v$session     vse,
       v$process     vsp,
       v$sqlarea     vsq
where  vop.saddr      = vse.saddr
and    vop.address    = vsq.address
and    vop.hash_value = vsq.hash_value
and    vsp.addr       = vse.paddr
and    vsp.spid       = &os_process_id

/

You can adjust this script for all executing statements - or - for a specific SID or PID.

Hope this helps.

Frank Received on Thu Aug 31 1995 - 00:00:00 CEST

Original text of this message