← Users & Privileges
Oracle · Users & Privileges

How to find locked and expired accounts in Oracle

Find locked, expired, and other non-open Oracle accounts that need attention, with lock and expiry dates.

Tested on11g12c19c21c23ai26ai

Accounts whose status is not OPEN: locked, expired, or both, with the lock and expiry dates and the profile behind them.

SELECT username,
       account_status,
       lock_date,
       expiry_date,
       profile
FROM   dba_users
WHERE  account_status <> 'OPEN'
ORDER  BY account_status, username;
accountslockedexpireddba_users