oracle last user login code example
Example 1: oracle user last connected
SELECT max(TIMESTAMP), A.USERNAME
FROM DBA_AUDIT_TRAIL A
WHERE ACTION_NAME = 'LOGON'
GROUP BY USERNAME
ORDER BY 1 DESC;
Example 2: oracle last user logon
SELECT USERNAME, max(TIMESTAMP) FROM DBA_AUDIT_TRAIL
WHERE ACTION_NAME = 'LOGON' AND USERNAME = 'MY_USER'
GROUP BY USERNAME ORDER BY 1;