Thanks for the question, mark.
Asked: May 29, 2020 - 1:03 pm UTC
Last updated: May 29, 2020 - 1:27 pm UTC
Version: 12.1
Viewed 1000+ times
select username, last_login from dba_users where username in (select username from all_users where oracle_maintained = 'N') and username NOT IN ('DBAMETRICS') and last_login <= TRUNC(SYSDATE) - 15 order by last_login ASC;
select username, last_login, TRUNC(SYSDATE) - trunc ( last_login ) days from dba_users where username in (select username from all_users where oracle_maintained = 'N') and username NOT IN ('DBAMETRICS') and last_login <= TRUNC(SYSDATE) - 15 order by last_login ASC; USERNAME LAST_LOGIN DAYS HR 12-MAY-2020 15.29.45 +01 17
mark dickinson, May 29, 2020 - 1:32 pm UTC
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library