Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Looking for a script.

Re: Looking for a script.

From: Michael Smith <msmith_at_omnipaygroup.com>
Date: Thu, 1 Nov 2001 17:17:50 -0000
Message-ID: <9rrvum$jd1$1@kermit.esat.net>


Thy this .... it'll show you all sql and who is running it currently being run. you'll have to run this query at the same time the user is running their sql because it only takes a snap shot so it'll only really work if it's a long running user query

select s.username,
 s.sid,
 text.sql_text,
 text.piece
from v$session s,

 v$sql sql,
 v$process p,
 v$sqltext text
where   sql.address=s.sql_address
and     sql.hash_value=s.sql_hash_value
and     text.address=s.sql_address
and     text.hash_value=s.sql_hash_value
and     p.addr=s.paddr
and     s.status='ACTIVE'

and s.username is not null
order by sid,text.piece;

Regards
Michael Smith, oracle dba, dublin

"Ash" <akhi9031_at_yahoo.com> wrote in message news:7fcfcf73.0111010829.562d39c4_at_posting.google.com...
> Hi
> I was looking for a sql scripts for Oracle 8.0.5.
>
> "Displays the user and the text of the statement the user is executing"
>
> Thanks
Received on Thu Nov 01 2001 - 11:17:50 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US