denrepo

OracleSecurity & users

Accounts locked, expired or expiring soon

Application accounts that aren't OPEN, or whose passwords expire in the next 14 days. Catch service accounts before they break an application.

12c+

Not yet verified. How scripts are tested

ora-users-attention.sql
1CLEAR COLUMNS2SET LINESIZE 140 PAGESIZE 200 TRIMOUT ON TAB OFF3COLUMN username       FORMAT A254COLUMN account_status HEADING "STATUS"  FORMAT A255COLUMN expires        FORMAT A106COLUMN locked         FORMAT A107COLUMN profile        FORMAT A208 9SELECT username, account_status,10       TO_CHAR(expiry_date, 'YYYY-MM-DD') AS expires,11       TO_CHAR(lock_date, 'YYYY-MM-DD') AS locked,12       profile13FROM dba_users14WHERE oracle_maintained = 'N'15  AND (account_status <> 'OPEN' OR expiry_date < SYSDATE + 14)16ORDER BY expiry_date NULLS LAST, username;

Save it as ora-users-attention.sql and run it with SQL> @ora-users-attention.

Open in denrepo

Helps with

Part of these runbooks

More Oracle scripts: Security & users