Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [PL/SQL] Capturing instance/sesssion info?
user is the loged on user. Try it from sqlplus:
select user from dual;
I think you can get it from application context. Go to asktom.oracle.com and
do a search.
Jim
-- Replace part of the email address: kennedy-down_with_spammers_at_attbi.com with family. Remove the negative part, keep the minus sign. You can figure it out. "Luch" <optimaljedi_at_hotmail.com> wrote in message news:3d047c59.0301130717.72630ddf_at_posting.google.com...Received on Mon Jan 13 2003 - 09:55:46 CST
> Is there an easy way to access session info from PL/SQL. For
> instance... I'd like to have a delete trigger on a table where I can
> get the record deleted (this I know) plus info on the user/session
> that did it (so I can insert it into another table). This is the kind
> of info I'd like, I'm hoping there's an easier way to get it:
>
> select s.sid, s.status, s.username, RTRIM(s.osuser), b.spid,
> s.machine, s.program, s.resource_consumer_group, r.timeout
> from v$session s, v$session_longops l, v$process b, dba_resumable r
> where (s.sid = l.sid(+)) and
> (s.sid = r.session_id(+)) and s.paddr=b.addr group by r.session_id,
> r.error_number, r.status, s.sid,
> s.status, s.username, s.osuser, b.spid, s.machine,
> s.program,s.resource_consumer_group, r.timeout
> ;