Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> [PL/SQL] Capturing instance/sesssion info?
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 ; Received on Mon Jan 13 2003 - 09:17:46 CST
![]() |
![]() |