ORA-28000: The Account Is Locked: Causes and Fixes
ORA-28000 means Oracle Database has locked the user account because of repeated failed logins, an administrator’s action, or a common-user lock in the root container. To restore access, check the account’s status, then either wait for a timed lock to expire or have an authorized administrator unlock it. Stop applications that are retrying with incorrect credentials before restoring access.
Use these symptoms to identify the right starting point.
| Symptom | Likely Cause | What to Do |
|---|---|---|
| Login stops working after repeated password errors | The account’s failed-login threshold was reached | Check its status and password profile |
| An account was deliberately disabled | An administrator applied a lock | Confirm that access should be restored before unlocking |
| Login works after an unlock, then fails again | An application, job, or saved connection is still using incorrect credentials | Find and correct the retrying client |
| A common user cannot connect through a pluggable database | The user may be locked in the root container | Have the CDB administrator check the root-level account |
| An unlock at a disaster-recovery site returns ORA-16000 | The command is running against a read-only database or PDB | Confirm the database role and involve the Data Guard administrator |
What ORA-28000 Means
ORA-28000 is a database-account error, not a problem with your laptop’s login or necessarily with your Oracle website account. SQL Developer, SQL*Plus, a Python application, and a Java connection pool can all display it because they are receiving the same rejection from Oracle Database.
A correct password does not bypass an account lock. Likewise, changing database clients does not remove the lock.
The important distinction is between the account’s current state and the event that caused it. The current state tells you whether waiting or administrative action is appropriate. Finding the responsible application or person generally requires logs or audit records.
How to Fix ORA-28000 Safely
Safely resolve ORA-28000 by stopping repeated connections, checking the account’s lock state and effective profile, and using an authorized administrative connection.
Step 1: Pause Retries and Confirm the Connection Target
- Pause clients that are repeatedly trying to connect. Check application connection pools, scheduled jobs, monitoring services, development tools, and containers using the account. Otherwise, a successful unlock can be followed immediately by another lock.
- Record the connection details without recording the password. Capture the database username, host, service name, error time, and affected application. In a multitenant database, the service determines which container you reach.
- Use a separate authorized administrative connection. The account used for diagnosis needs access to the relevant dictionary views; changing another user’s account requires the appropriate administrative privilege. A routine application-account unlock does not inherently require connecting as SYS.
If you cannot make that administrative connection, give the details to your DBA rather than continuing to guess passwords. Include whether a password rotation, deployment, or configuration change happened immediately before the failure.
Step 2: Check the Database User’s Lock State
- Query the affected account. In these examples, replace
APP_USERwith the actual database username.
SELECT username, account_status, lock_date, profile
FROM dba_users
WHERE username = 'APP_USER';
Oracle Database stores the user’s lock state in the ACCOUNT_STATUS column of DBA_USERS, as documented in its ORA-28000 error guidance.
Unquoted Oracle usernames are normally stored in uppercase. If the account was created with a quoted, case-sensitive name, use its exact stored spelling.
- Interpret the result before changing anything: –
LOCKED(TIMED)indicates a password-profile lock. Whether waiting can restore access depends on the configured duration. –LOCKEDmeans you should not assume that a timed wait will restore access. Have an administrator confirm the reason and whether unlocking is authorized. – A status containing bothEXPIREDandLOCKEDrequires attention to the password as well as the lock. –OPENmeans the account is not currently locked in the database container you queried. Check the application’s actual destination and whether the error is still occurring. - If the query returns no row, check the username and container. Do not create a replacement user merely because the account is absent from the current container.
The lock date is useful for correlating events, but it does not identify the client that caused the lock.
Step 3: Inspect the Effective Password Profile
- Read the account’s password-profile limits and the corresponding default-profile values.
SELECT profile, resource_name, limit
FROM dba_profiles
WHERE resource_type = 'PASSWORD'
AND (
profile = 'DEFAULT'
OR profile = (
SELECT profile
FROM dba_users
WHERE username = 'APP_USER'
)
)
AND resource_name IN (
'PASSWORD_LOCK_TIME',
'FAILED_LOGIN_ATTEMPTS'
)
ORDER BY profile, resource_name;
- Resolve any inherited values. If a resource’s limit is
DEFAULT, its effective value comes from theDEFAULTprofile; the word does not itself specify a duration or attempt count. - Check the duration before choosing to wait.
PASSWORD_LOCK_TIMEis measured in days, including fractional days. Oracle Database 19c’s documented default is 1 day, or 24 hours, but the account’s effective profile can differ. - Check the threshold when investigating password-triggered locks.
FAILED_LOGIN_ATTEMPTSis the number of consecutive failed login attempts permitted before locking. Oracle Database 19c’s documented default is 10 attempts, but use the effective value from this database rather than assuming the default applies.
There is no reliable universal range for a customized database profile. The live values determine the behavior of this account.
Step 4: Restore Access With the Appropriate Method
Choose the applicable route; waiting and manual unlocking are alternatives.
For a finite timed lock, correct the credentials, wait for the lock interval to expire, and test access:
- Correct the known credential mismatch in the affected client, keeping automated retries paused.
- Allow the configured lock interval to expire.
- Make a fresh connection through the intended database service using the approved current credentials.
- If the connection succeeds, restore applications and jobs with their corrected configuration. If it fails, stop further retries and have the DBA inspect the current state.
Waiting is not the right response to an intentional administrative lock without approval to restore access.
Have an authorized administrator perform the account changes in this manual-unlock procedure:
- Confirm that the lock is not intentional and that restoring access is authorized.
- If the password is also expired, change it through an approved password-management workflow. Handle any required password change in an authorized session:
PASSWORD APP_USER
This is a SQL*Plus command, not a SQL statement for arbitrary database editors. Coordinate a service-account password change with every application that uses it; a reset is not necessary merely to remove a lock.
- Run the
ALTER USERcommand with theACCOUNT UNLOCKclause against the correct database container:
ALTER USER APP_USER ACCOUNT UNLOCK;
Use the account’s exact identifier, including double quotes if it was created as a quoted, case-sensitive username.
- Verify access with a fresh login as the affected account through the intended database service. Then resume the corrected application and confirm that it can create a new connection.
Do not put passwords in command-line arguments, connection URLs saved in shell history, or incident tickets.
Why the Oracle User Keeps Getting Locked
Unlocking restores access; it does not fix the process submitting the wrong password.
If the account locks again, investigate the callers before resetting the password. A background client can submit enough failures to trigger a new lock while an administrator is still testing.
Find Every Consumer of the Credentials
Check places where an old password can remain after a rotation:
- Application connection-pool configuration.
- Scheduled scripts and background workers.
- Monitoring and reporting tools.
- Saved database-client connections.
- CI/CD variables and deployment configuration.
- Docker container environment variables.
- Kubernetes Secrets and the workloads that consume them.
Updating the central secret is not always enough. A running process may retain the old value in memory, and an existing connection pool may continue using cached credentials when it creates new connections.
For affected Kubernetes workloads, verify that the credential configuration contains the current password. Use the workload’s normal rollout procedure so replacement processes receive the new value.
After correcting each consumer, test a fresh connection from that consumer, not just a query through an already-open database session.
Identify the Login Source in Audit Records
Where unified auditing captures unsuccessful logons, an authorized administrator can inspect the recorded failures:
SELECT event_timestamp,
dbusername,
userhost,
client_program_name,
return_code
FROM unified_audit_trail
WHERE dbusername = 'APP_USER'
AND action_name = 'LOGON'
AND return_code <> 0
ORDER BY event_timestamp DESC;
Use the timestamps, host, and client program to correlate failures with application logs and deployment events. Client-identification fields may be incomplete, so they are clues rather than guaranteed attribution.
Look for invalid-credential failures before the lock, not only rejected connections after the account was already locked. If an administrative lock is suspected, the DBA should also inspect audited user-management activity around that time.
Audit history exists only if the relevant events were captured and retained. An empty result does not prove that no failed attempts occurred. Older or differently configured databases may require the DBA to inspect the applicable traditional audit trail instead.
Locked Accounts in PDBs and Data Guard
Common Users Locked in the Root Container
In a multitenant database, the current container matters. An administrator can check the session’s container with:
SELECT SYS_CONTEXT('USERENV', 'CON_NAME') AS container_name
FROM dual;
A local PDB user must be diagnosed in its PDB. For a common user, a root-level lock can prevent access through a PDB even when the investigation began there.
Have the CDB administrator inspect the common user in the root container and apply any authorized change with the intended container scope. Do not assume a PDB-local action clears a root-level restriction, or apply an all-container change without checking its consequences.
After the administrator restores access, test the account through the original PDB service and confirm that the affected application can establish a new session.
Read-Only Standbys and SYS Accounts at a DR Site
An account-unlock command against a read-only physical standby can fail with ORA-16000. That is a database-role or open-mode restriction, not evidence that the unlock statement needs a different spelling.
An authorized administrator can inspect the destination:
SELECT database_role, open_mode
FROM v$database;
For Data Guard, the DBA must determine whether the relevant restriction originates on the primary or involves standby authentication behavior, then use the procedure supported for that version and configuration. Do not change the standby’s role or open it read/write merely to force an account-unlock command to succeed.
If the affected account is SYS, also distinguish an ordinary database login from the intended administrative connection. Administrative role, authentication method, and password-file configuration can matter at a DR site; the ordinary user-account status alone does not establish whether SYSDBA authentication is working.
Once the Data Guard administrator resolves the restriction, test the intended connection against the DR service. Verify application connectivity separately from privileged administrative access.
How to Confirm the Fix and Prevent Another Lock
A successful administrative command is only part of the result. Finish with these checks:
- Current account state: Verify that no lock or expiration condition remains for the intended user in the intended container.
- Fresh direct login: Connect with the affected account rather than relying on an existing session.
- Fresh application connection: Confirm that the application can create a new connection through its actual configured service.
- Corrected credential consumers: Resume paused jobs and services only after their credentials are current.
- Clean follow-up logs: Check that resumed clients are no longer generating authentication failures.
For recurring incidents, maintain an inventory of applications using each service account and coordinate password rotations with those applications. Avoid sharing one database account across unrelated services when separate accounts are practical; separate identities make both attribution and recovery easier.
Do not disable lockout protection or weaken a shared password profile as a shortcut. A profile change can affect other users assigned to it while leaving the underlying credential mismatch unresolved.
Once direct and application connections both succeed, restore normal operation. If the lock returns, keep the retrying client paused and identify its connection source before unlocking again.
Frequently Asked Questions
Can I Unlock an Oracle Account Without DBA Privileges?
You need an authorized connection with the required privilege to alter the affected user; the DBA role itself is not the only way that privilege can be granted. An ordinary locked account cannot establish a normal new session to unlock itself. Without administrative access, a finite timed lock may expire automatically, or your DBA must intervene.
Will Restarting the Application or Database Unlock the Account?
Restarting is not an account-unlock procedure. Restarting an application can help it load corrected credentials, but doing so while it still has the wrong password may trigger more failures. Restore the account’s permitted login state and correct the client configuration before resuming connections.
Does Resetting My Oracle Website Password Fix ORA-28000?
Usually not: an Oracle website identity and an Oracle Database user are different accounts unless your organization has explicitly integrated their authentication. For example, the Oracle Life Sciences Identity and Access Management unlock procedure uses an identity-password reset; it is not the database-account unlock procedure. Give your administrator the exact database error, username, and service name so the correct account is addressed.
Is ORA-28000 the Same as ORA-01017?
No. ORA-28000 reports that the account is locked and login is denied. Repeated invalid-credential attempts can lead to a lock, so correcting the password and restoring the account’s login state may both be necessary.
What does DBA_USERS show for a locked Oracle account?
Check the ACCOUNT_STATUS column in DBA_USERS to confirm the account’s current state. Common documented causes include too many consecutive failed credential attempts or an administrator-applied lock.
