Currently I am trying to figure out a solution that'll help audit / keep record of Users and their last logon time onto a specific DB. Right now, I am able to query (minus some predicates):
select
username,
last_login
from
dba_users
WHERE profile = 'USER_PROFILE'
order by
username;
This obviously works, however it doesn't describe which specific DB was the last logon, as we have multiple. Posting to figure out how to make this happen, if possible.
Thank you for taking your time to read this, hope to figure this out!
The output should look something like:
| USER | LASTLOG | DB |
|---|---|---|
| U01 | TIME | DB1 |
| U01 | TIME | DB2 |
| U02 | TIME | DB3 |
| U03 | TIME | DB3 |