Oracle 23.26ConnectionLab-verified · 2026-11-29

ORA-28000: The account is locked; login denied

The user's account is locked, so even the correct password is refused.

Oracle AI Database 26ai Free 23.26.3.0.0
ORA-28000: The account is locked; login denied.

Jump to a cause

  1. 01Too many wrong passwords (profile FAILED_LOGIN_ATTEMPTS)
  2. 02Locked on purpose with ALTER USER ... ACCOUNT LOCK

Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-11-29 · container image gvenzl/oracle-free:23-slim

ORA-28000 means the account status is LOCKED. The password may be correct; Oracle refuses the login until the account is unlocked. In 23ai the message is The account is locked; login denied. (older versions: the account is locked). It appeared in English even with a Korean or Japanese session, because the language is not set before login.

The two common causes are a profile that locks the account after repeated wrong passwords, and a DBA locking it on purpose. In both runs below, dba_users.account_status showed LOCKED and ALTER USER lab_a ACCOUNT UNLOCK (run as system) fixed it.

01Too many wrong passwords (profile FAILED_LOGIN_ATTEMPTS)

lab_a uses a profile with FAILED_LOGIN_ATTEMPTS 3 and PASSWORD_LOCK_TIME UNLIMITED. Three logins with wrong passwords returned ORA-01017. The fourth login, with the correct password, returned ORA-28000.

dba_users showed LOCKED with profile APP_PROFILE, and dba_profiles showed the limits 3 and UNLIMITED. After ALTER USER lab_a ACCOUNT UNLOCK, the correct password logged in as LAB_A.

Setup
Setuprun as system
BEGIN
  FOR p IN (SELECT DISTINCT profile FROM dba_profiles WHERE profile = 'APP_PROFILE') LOOP
    EXECUTE IMMEDIATE 'DROP PROFILE app_profile CASCADE';
  END LOOP;
END;
/
CREATE PROFILE app_profile LIMIT FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME UNLIMITED;
ALTER USER lab_a PROFILE app_profile;
OUTPUT
PL/SQL procedure successfully completed.


Profile created.


User altered.
Reproducerun as system
CONNECT lab_a/wrong1@//localhost/FREEPDB1
CONNECT lab_a/wrong2@//localhost/FREEPDB1
CONNECT lab_a/wrong3@//localhost/FREEPDB1
CONNECT lab_a/lab@//localhost/FREEPDB1
✕ ERROR
ERROR:
ORA-01017: invalid credential or not authorized; logon denied
Help: https://docs.oracle.com/error-help/db/ora-01017/


Warning: You are no longer connected to ORACLE.
ERROR:
ORA-01017: invalid credential or not authorized; logon denied
Help: https://docs.oracle.com/error-help/db/ora-01017/


ERROR:
ORA-01017: invalid credential or not authorized; logon denied
Help: https://docs.oracle.com/error-help/db/ora-01017/


ERROR:
ORA-28000: The account is locked; login denied.
Help: https://docs.oracle.com/error-help/db/ora-28000/
Checkrun as system
COLUMN account_status FORMAT A16
COLUMN profile FORMAT A12
SELECT username, account_status, profile FROM dba_users WHERE username = 'LAB_A';
COLUMN limit FORMAT A10
SELECT resource_name, limit FROM dba_profiles WHERE profile = 'APP_PROFILE' AND resource_name IN ('FAILED_LOGIN_ATTEMPTS', 'PASSWORD_LOCK_TIME') ORDER BY resource_name;
OUTPUT
USERNAME                       ACCOUNT_STATUS   PROFILE
------------------------------ ---------------- ------------
LAB_A                          LOCKED           APP_PROFILE

1 row selected.


RESOURCE_NAME                    LIMIT
-------------------------------- ----------
FAILED_LOGIN_ATTEMPTS            3
PASSWORD_LOCK_TIME               UNLIMITED

2 rows selected.
Fixrun as system
ALTER USER lab_a ACCOUNT UNLOCK;
OUTPUT
User altered.

If an application or batch job still has the old password, it will lock the account again. Fix the password there before unlocking.

After the fixrun as system
CONNECT lab_a/lab@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;
✓ SUCCESS
LOGIN_USER
------------
LAB_A

1 row selected.

02Locked on purpose with ALTER USER ... ACCOUNT LOCK

The DBA ran ALTER USER lab_a ACCOUNT LOCK. The login with the correct password returned ORA-28000 at once, without any ORA-01017 before it.

dba_users showed account_status LOCKED and a lock_date. After ALTER USER lab_a ACCOUNT UNLOCK, the login worked.

Setup
Setuprun as system
ALTER USER lab_a ACCOUNT LOCK;
OUTPUT
User altered.
Reproducerun as system
CONNECT lab_a/lab@//localhost/FREEPDB1
✕ ERROR
ERROR:
ORA-28000: The account is locked; login denied.
Help: https://docs.oracle.com/error-help/db/ora-28000/


Warning: You are no longer connected to ORACLE.
Checkrun as system
COLUMN account_status FORMAT A16
SELECT username, account_status, TO_CHAR(lock_date, 'YYYY-MM-DD') AS locked_on FROM dba_users WHERE username = 'LAB_A';
OUTPUT
USERNAME                       ACCOUNT_STATUS   LOCKED_ON
------------------------------ ---------------- ----------
LAB_A                          LOCKED           2026-11-29

1 row selected.
Fixrun as system
ALTER USER lab_a ACCOUNT UNLOCK;
OUTPUT
User altered.
After the fixrun as system
CONNECT lab_a/lab@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;
✓ SUCCESS
LOGIN_USER
------------
LAB_A

1 row selected.

FAQ

How do I unlock a user in Oracle?

As a DBA user, run ALTER USER <name> ACCOUNT UNLOCK;. That fixed both cases above.

How do I check if an account is locked?

SELECT username, account_status, lock_date FROM dba_users WHERE username = 'LAB_A';. A locked account showed LOCKED.

Why does my account keep getting locked?

Wrong passwords hit the profile's FAILED_LOGIN_ATTEMPTS. In the first case the 3 failures locked it. Look for a program still using an old password.

Why did I get ORA-01017 first and then ORA-28000?

The wrong passwords give ORA-01017. Once the limit is reached, the account locks and the next login, even with the right password, gives ORA-28000.

How we verify

Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.

lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0