Audit Database Shutdown/Startup
I'm trying to capture audit information for when the database is shutdown and started. I know that the information I'm looking for are captured in the audit tables or files if I have auditing enabled.
BUT I'm doing something where I need it store it in my own table in the database.
So I've using before shutdown and after startup triggers.
My main question is this: I'm trying to capture the username that has issued the shutdown command. In the trigger's pl/sql, "user" will normal hold this information, but I realized that when you are logged in as SYSDBA, then "user" no longer holds your username, rather it is set to "SYS". If you use SYSOPER, then "user" is set to "PUBLIC".
Is there any other variables, like "user", in pl/sql that hold other session information - perhaps "OS User", "Machine Name", etc.??
I guess to get right to the point...
How can get my session's serial# and sid?
If I can get this information, then I can use it to get other info from v$session.
get sid from v$mystat or use userenv()
Click Here to Expand Forum to Full Width