ORA-28000: the account is locked

Applies to: Database Management Software Oracle 10g to Oracle 11g Std/Enterprise Editions

Issue: On login to the database use gets "ORA-28000: the account is locked" error like below.

[oracle@database orcl]$ sqlplus scott/tiger

SQL*Plus: Release 11.2.0.2.0 Production on Mon Feb 11 22:24:23 2013

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

ERROR:
ORA-28000: the account is locked

Solution:

There are two situations when your account could be locked.

1. New Database Creation: When you create a new database all default accounts are "EXPIRED & LOCKED" except SYS and SYSTEM. So, you need to unlock and change password to use them.

SQL> select username,account_status from dba_users;

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
SYS                                 OPEN
SYSTEM                         OPEN
SCOTT                            EXPIRED & LOCKED
OUTLN                           EXPIRED & LOCKED
MGMT_VIEW                EXPIRED & LOCKED
-----------------------------------------------------------------
-----------------------------------------------------------------
30 rows selected.

2. Failed Login Attempts: Default profile in oracle Database Management Software has 10 failed login attempts and after that it locks the user account. So, need to unlock this.

SQL> select * from dba_profiles where resource_name like 'FAILED_LOGIN_ATTEMPTS%';

PROFILE                        RESOURCE_NAME                    RESOURCE              LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT                        FAILED_LOGIN_ATTEMPTS            PASSWORD      10
MONITORING_PROFILE    FAILED_LOGIN_ATTEMPTS      PASSWORD      UNLIMITED

Connect as sysdba user and unlock the account using below commands

[oracle@database orcl]$ sqlplus sys as sysdba


SQL> alter user scott identified by tiger account unlock;

User altered. 

Now, Try to reconnect using locked user

SQL> connect scott/tiger
Connected.
SQL>

Account is unlock and ready to use.

8 comments: