I'd like to be able to set a trace on all sessions for a particular user. There may be sessions where the user connects, executes a few SQL statements and disconnects. How can I do this?
I don't want to set the trace on in init.ora to capture all user session info. I can set tracing on for a current session by:
ALTER SESSION SET SQL_TRACE=TRUE
or by specifying the session id.
But once the session closes/disconnects and the user later re-connects, I would need to reset the trace flag for the new session. There may be very many sessions.
Can I create a trigger for After Logon that will set the flag just for that user?
Can someone give me some help for how to do that?
You can use
sid and serial# can be found in v$session using
where audsid = userenv('sessionid');
Hope this helps
Click Here to Expand Forum to Full Width