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: viewing users sql

Re: viewing users sql

From: Steve Howard <stephen.howard_at_us.pwcglobal.com>
Date: 30 Dec 2003 11:20:10 -0800
Message-ID: <6d8b7216.0312301120.42e4187e@posting.google.com>


zipper59er_at_yahoo.com (chet) wrote in message news:<3988d00.0312292131.969fbe3_at_posting.google.com>...
> I would like to see all sql issued by a user for a currently open
> session. Is there a way to do this?
> -thank you

Try this...

select distinct spid,

       s.sid,
       s.serial#,to_char(sysdate - last_call_et/(24*3600),'mm/dd/yy
hh24:mi:ss') "LAST_ACTIVITY",
       logon_time,
       osuser,
       s.program,
       schemaname,
       sql_text
  from v$session s,
       v$process p,
       v$sql t
  where s.paddr=p.addr

    and t.hash_value(+)=s.sql_hash_value     and s.type !='BACKGROUND';

Regards,

Steve Received on Tue Dec 30 2003 - 13:20:10 CST

Original text of this message

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