Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: viewing users sql
stephen.howard_at_us.pwcglobal.com (Steve Howard) wrote in message news:<6d8b7216.0312301120.42e4187e_at_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
thank you. How long does data stay in the v$ views before it is
purged. i.e how far back can i look at sessions?
Received on Wed Dec 31 2003 - 08:04:43 CST