Auditing user logon and logoff in Oracle

To track when a user logs on or off Oracle, enable auditing and audit CONNECT in your database.  Then you can query DBA_AUDIT_TRAIL to find logon and logoff info.

alter session SET NLS_DATE_FORMAT = 'DD-MM-YYYY HH24:MI:SS';

select username, action,action_name,timestamp,logoff_time from dba_audit_trail where action_name = 'LOGON' and username = '&user';

Here are some more helpful links:
http://itechshare.blogspot.com/2010/06/oracle-how-to-track-logon-logout-in.html
http://itechshare.blogspot.com/2010/06/oracle-why-dbaaudittrail-shows-more.html

Comments

Popular posts from this blog

RMAN Restore vs. Recovery - what's the difference?

Use rsync on Unix to backup your archive logs