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.
Not yet verified. How scripts are tested
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.
Helps with
- ORA-01017: invalid username/password; logon denied
- ORA-28001: the password has expired
- ORA-28002: the password will expire within %s days
Part of these runbooks
More Oracle scripts: Security & users
- Who has DBA, SYSDBA and powerful system privilegesNon-Oracle accounts and roles holding the DBA role or high-risk ANY privileges, then everyone in the password file. Worth reviewing every audit cycle.
- CMU step 1: prepare Active DirectoryDone once by an AD administrator before any database work: create the service account the database binds with, install Oracle's password filter on…
- CMU step 2: export the AD root certificateThe database talks to AD over LDAPS, so its wallet must trust the certificate authority that issued the domain controllers' certificates. Export that…
- CMU step 3: create the walletBuilds the auto-login wallet the database reads at login: the service account's user name, DN and password, plus the AD root certificate. With PDBs,…
- CMU step 4: create dsi.oraTells the database which domain controllers to use. Put it in the same folder as the wallet from step 3. Use fully qualified host names, and list at…
- CMU step 5: point each PDB at its wallet (CMU_WALLET)Creates a directory object for the wallet folder from step 3 and sets the CMU_WALLET database property in the PDB, so CMU reads that PDB's wallet and…