OracleSecurity & users
Unlock an account or reset its password
Change the username and password before running. Quote the password so special characters are kept.
Not yet verified. How scripts are tested
1ALTER USER app_user ACCOUNT UNLOCK;2 3-- To also reset the password:4-- ALTER USER app_user IDENTIFIED BY "New_Passw0rd_2026";Save it as ora-unlock.sql and run it with SQL> @ora-unlock.
Helps with
- ORA-01017: invalid username/password; logon denied
- ORA-28000: the account is locked
- ORA-28001: the password has expired
More Oracle scripts: Security & users
- Accounts locked, expired or expiring soonApplication accounts that aren't OPEN, or whose passwords expire in the next 14 days. Catch service accounts before they break an application.
- 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…