SQL Language (MOSC)

MOSC Banner

Need help with script to find users last login/logout from $AUD

edited Dec 6, 2012 10:14AM in SQL Language (MOSC) 2 commentsAnswered ✓
Oracle Version: 10.2.0.4
I am trying to create a sql script which returns the last login/logout activity of each user from the audit log file.

I have the following script which seems correct but returns 0 records: (yes auditing is turned on and I am auditing on create session success: by access and failure: by access)

COLUMN username FORMAT A10
COLUMN owner    FORMAT A10
COLUMN obj_name FORMAT A10
COLUMN extended_timestamp FORMAT A35

SELECT username,
      extended_timestamp,
      owner,
      obj_name,
      action_name
FROM dba_audit_trail outer
where
   extended_timestamp =
   (
      select max(extended_timestamp)
      from dba_audit_trail inner
      where inner.owner = outer.owner

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center