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.
Asked
Active
Viewed 1.8k times
2 Answers
3
Enable auditing.
Then audit connects - very easy command
audit connect
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

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