How to solve ORA-28001: The password has expired

The other day I was happily opening SQL Developer when I found this horrible thing.

Here is how to solve it.

  1. Connect as sysdba to the database.
C:UsersSiry>sqlplus / as sysdba
  1. Run the query to set the password’s life time to unlimited.
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Profile altered.
  1. Set a password for the locked user.
SQL> ALTER USER user_name IDENTIFIED BY password;
User altered.
  1. Unlock the user account.
SQL> ALTER USER user_name ACCOUNT UNLOCK;
User altered.
  1. Make sure your user is not locked anymore.
SQL> SELECT USERNAME,ACCOUNT_STATUS FROM DBA_USERS;

USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
HR                             OPEN
ANONYMOUS                      OPEN
APEX_040000                    LOCKED
FLOWS_FILES                    LOCKED
XDB                            EXPIRED & LOCKED
CTXSYS                         EXPIRED & LOCKED
MDSYS                          EXPIRED & LOCKED
SYSTEM                         OPEN
SYS                            OPEN
user_name                      OPEN
SIRY                           OPEN

USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
APEX_PUBLIC_USER               LOCKED
XS$NULL                        EXPIRED & LOCKED
OUTLN                          EXPIRED & LOCKED

15 rows selected.

Remember that password represents variable and should be replaced with your own.

Please note that this may NOT be the best option for you specially if you are not using your database only for development/testing which is my case. I do not recommend to do this in a production environment.

Sources