1

please let me know How to Find When the User Last Logged into the Database? please let me know how to check this information with the command.

nathan
  • 29
  • 1
  • 2
  • 5

2 Answers2

3

Enable auditing.

Then audit connects - very easy command

audit connect

Docs Link Here

Then do some connects.

Then query sys.dba_audit_session -

SELECT
    username,
    timestamp
FROM
    sys.dba_audit_session
WHERE
    username = 'HR' -- the user you care about
    AND action_name = 'LOGON'
ORDER BY
    timestamp DESC
FETCH FIRST 1 ROWS ONLY -- in 11g or older just also say where rownum < 2

enter image description here

thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
0

Try this:

select username, machine, to_char(logon_time,'HH:MM:SS')
from v$session 
where username='SYS'  <-- username
Georgy
  • 428
  • 2
  • 16
  • let me know the last modified (DML opearation) – nathan Dec 10 '18 at 10:13
  • Check these links: [How to find out when an Oracle table was updated the last time](https://stackoverflow.com/a/265507/10457877) and [How to get a last DML operation](https://dba.stackexchange.com/a/115067) – Georgy Dec 10 '18 at 10:37