Today I came about a very annoying exception. After my development setup was running smoothly for the last six months, my application was getting database errors today. I know that I didn’t break something, so the problem had to be somewhere else – and it was: ORA-28001: the password has expired
If you install an Oracle database on a Windows system, the default password policy will make all passwords expire after exactly six months! Great. So here’s how to fix that:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
-- Show all users, their expiry date and current status -- This helps you to identify the locked users SELECT username, expiry_date, account_status FROM dba_users; -- Show the profiles of the users -- The profile defines the password policy SELECT username, profile FROM DBA_USERS; -- Alter the "default" profile and disable the expiry date for it -- By default, most users will have this profile ALTER PROFILE "DEFAULT" LIMIT PASSWORD_VERIFY_FUNCTION NULL; -- Unlock the users which are already locked ALTER USER <user name> IDENTIFIED BY <password> ACCOUNT UNLOCK; |
Best regards,
Thomas
Genial!!