Hi,
3 slqs that show you  sql text when you  enter unix  process id or Oracle
SID:

undefine unixpid

select a.USERNAME,a.SPID "unix
pid",b.SID,b.serial#,b.osuser,b.program,a.program
from v$process a, v$session b
where a.spid='&unixpid'
and a.addr=b.paddr
/
undefine unixpid

select a.USERNAME,a.SPID,b.SID,b.serial#,b.osuser,b.terminal,c.sql_text
from v$process a, v$session b, v$sql c
where spid='&&unixpid'
and a.addr=b.paddr
and b.sql_address=c.address
and b.sql_hash_value=c.hash_value
/

prompt Otros cursores abiertos...
SELECT /*+ index(c) index(q) use_nl(q) */ q.piece, q.sql_text
FROM v$open_cursor c, v$sqltext_with_newlines q, v$session b, v$process a
where a.spid='&&unixpid' and
a.addr=b.paddr and
c.sid = b.sid and
c.address = q.address and
c.hash_value = q.hash_value
order by q.address, q.hash_value, q.piece asc
/

select a.USERNAME,a.SPID "unix
pid",b.SID,b.serial#,b.osuser,b.program,a.program
from v$process a, v$session b
where a.addr=b.paddr
and b.sid=&SID
/


----- Original Message -----
To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
Sent: Monday, March 11, 2002 12:28 PM


>
> Hi
> Does any one have sql scripts which show us sql text when we enter unix
> process id or oracle SID ?
> Please send if any one have.
> Thx
> -Seema
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Seema Singh
>   INET: [EMAIL PROTECTED]
>
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Natalia Laracca
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to