Pages

Monday, December 16, 2013

ORA-28000: the account is locked

When you try to login as a user to your database and you get the following error:

$ sqlplus "user/password@database"
...
ORA-28000: the account is locked


Then login as sys first:

$ sqlplus "sys/password@database as sysdba"
...


Check for the user:

SQL> select username,account_status,expiry_date,profile from dba_users where username = 'user';

USERNAME ACCOUNT_STATUS EXPIRY_D PROFILE
-------- -------------- -------- -------
USER     LOCKED                  DEFAULT


Unlock the specific account and recheck the user:

SQL> alter user USER account unlock;
SQL> select username,account_status,expiry_date,profile from dba_users where username = 'user';

USERNAME ACCOUNT_STATUS EXPIRY_D PROFILE
-------- -------------- -------- -------
USER     OPEN                    DEFAULT