Identifying "my" session in v$session?
From: David Trahan <p00775_at_psilink.com>
Date: Mon, 03 Jan 94 08:03:42 -0500
Message-ID: <2966688138.0.p00775_at_psilink.com>
Date: Mon, 03 Jan 94 08:03:42 -0500
Message-ID: <2966688138.0.p00775_at_psilink.com>
Greetings,
I'm working on a trigger that effectively "audits" transactions on a certain table. I'd like the trigger to have access to certain information about the "current" session (that is - the one that triggered the trigger) such as terminal name, hostname, etc. The stuff I'm looking for is mostly in V$SESSION, but I'm not sure how to figure out which row corresponds with the "current" session. I can't just use USERNAME because more than one session may be active with the same username.
I noticed that USERENV('SESSIONID') seems to correspond with the AUDSID column from V$SESSION:
- Is this a "guaranteed" relationship - it certainly is not clearly documented as such?
- The documentation implies that AUDSID is related to "auditing" - does it's content change depending upon whether or not I have auditing enabled?
- Are there ANY circumstances under which AUDSID and USERENV('SESSIONID') will not match? (I did notice that if I CONNECT INTERNAL through SQLDBA, the AUDSID column is 0 - I can handle that, but I need to know if there are other similar circumstances.
- Is there are better way to determine the relationship between "current" session and V$SESSION?
Thanx in advance for any help you can offer! Dave Trahan p00775_at_psilink.comReceived on Mon Jan 03 1994 - 14:03:42 CET