Wednesday, November 13, 2013

How To Check User Login Information In The Past

Use DBA_HIST_ACTIVE_SESS_HISTORY:

To get client machine name:
SELECT distinct machine  FROM DBA_HIST_ACTIVE_SESS_HISTORY

To get timeframe
SELECT *   FROM DBA_HIST_ACTIVE_SESS_HISTORY where sql_exec_start  > sysdate -7  order by sql_exec_start desc

To get User name

SELECT  user_id  FROM DBA_HIST_ACTIVE_SESS_HISTORY where sql_exec_start  > sysdate -7  order by sql_exec_start desc

user user_id to get name from dba_users

No comments: