Wednesday, December 7, 2016

Solving ORA-28001: the password has expired

It always happens when you are in a hurry and it makes you really upset. It's nothing to get desperate, though. To solve it, follow the steps below:

Connect as sysdba to the database:

> sudo su - oracle

> sqlplus sys as sysdba


Set password life time to unlimited in Oracle:

SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Profile altered.


Reset the password for the locked user:

SQL> ALTER USER <user_name> IDENTIFIED BY <password>;

User altered.


Unlock the user account:

SQL> ALTER USER user_name ACCOUNT UNLOCK;

User altered.


Check if the user account is actually unlocked:

SQL>  SELECT USERNAME,ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME='<user_name>'


ACCOUNT_STATUS should be OPEN.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.