Fix: ORA-01017: invalid username/password; logon denied
Oracle rejected the login. Check the password (case-sensitive), that you connect to the right PDB service, and whether the account is locked with ORA-28000.
Not checked by a trusted editor yet Last edited Outdated?
In Oracle Database 19c the error reads:
ORA-01017: invalid username/password; logon denied
Newer releases use broader wording, ORA-01017: invalid credential or not authorized; logon denied, because the same error also covers other authentication methods. Either way, the client reached the database (the listener and service were fine) and authentication failed.
Cause 1: wrong password, often by case
Oracle passwords are case-sensitive. Passwords containing special characters can also be split or changed by the shell or by SQL*Plus. Let the tool prompt for the password instead of putting it on the command line:
sqlplus [email protected]:1521/orclpdb1.example.com
Enter password:
If the password must be set in a script, quote it with double quotes inside SQL: ALTER USER appuser IDENTIFIED BY "CHANGE_ME#2026";
Cause 2: connected to the wrong container
A local user exists only in its own PDB. Connecting to the CDB root’s service, or to another PDB, with that user name fails with ORA-01017 even when the password is correct. Check the service name in your connect string, then verify where the user lives:
-- as a DBA in the root
SELECT con_id, username, account_status FROM cdb_users WHERE username = 'APPUSER';
SELECT con_id, name FROM v$pdbs;
Remember that unquoted user names are stored in upper case: appuser becomes APPUSER.
Cause 3: the password was changed or never set as expected
As a DBA connected to the right PDB, reset it and force a change at next login:
ALTER USER appuser IDENTIFIED BY "CHANGE_ME_Str0ng#1" PASSWORD EXPIRE;
Related: ORA-28000, the account is locked
Repeated failed logins usually end in a different error:
ORA-28000: The account is locked.
Oracle locks an account after FAILED_LOGIN_ATTEMPTS consecutive failures (a limit from the user’s profile), or when an administrator locked it, or for a common user locked in the root container. Depending on the profile’s PASSWORD_LOCK_TIME it unlocks itself after a while (status LOCKED(TIMED)) or stays locked until a DBA unlocks it.
SELECT username, account_status, lock_date, profile
FROM dba_users
WHERE username = 'APPUSER';
SELECT resource_name, limit
FROM dba_profiles
WHERE profile = 'DEFAULT'
AND resource_name IN ('FAILED_LOGIN_ATTEMPTS', 'PASSWORD_LOCK_TIME');
ALTER USER appuser ACCOUNT UNLOCK;
Before unlocking, find what kept trying the wrong password, typically an application server, a scheduled job or a connection pool with an old password. If you only unlock the account, that client locks it again within minutes. Update the stored credential first, then unlock.
Checklist
- Retype the password at the prompt, minding case.
- Confirm the service name points to the PDB where the user exists.
- Check
ACCOUNT_STATUSinDBA_USERS(OPEN,LOCKED,EXPIRED…). - Reset the password and update every client that stores it.
- Unlock the account only after the source of failed logins is fixed.
Official documentation
See also
- 0200 PostgreSQL roles, privileges and default privileges Create login and group roles, grant access to databases, schemas and tables, and use ALTER DEFAULT PRIVILEGES so tables created later get… Intermediate · How-to · Linux Article Roles & administration · Security & access 15 Oct 2026
- 0201 pg_hba.conf and PostgreSQL authentication methods pg_hba.conf decides who may connect from where and how they must prove who they are. Rules are checked top to bottom and… Intermediate · Concept · Linux Article Install & connect · Security & access 15 Oct 2026
- 0209 Fix: FATAL: password authentication failed for user PostgreSQL reached the server and found a matching pg_hba.conf rule, but the password check failed. Usually a wrong password, a role without… Intermediate · Fix · Any system Article Roles & administration · Security & access 15 Oct 2026
- 0210 Fix: FATAL: no pg_hba.conf entry for host The server received the connection but no pg_hba.conf rule matches this client address, user, database and SSL mode. Add or correct a… Intermediate · Fix · Linux Article Install & connect · Security & access 15 Oct 2026
- 0214 MySQL users and privileges: CREATE USER, GRANT and authentication plugins A MySQL account is a user name plus the host it connects from. You create it with CREATE USER, give it rights… Beginner · How-to · Linux Article Administration · Security & access 15 Oct 2026
- 0220 Fix: ERROR 1045 (28000): Access denied for user ‘appuser’@’localhost’ (using password: YES) The server rejected the user, host and password combination. Usually it is a wrong password, a host part that does not match,… Beginner · Fix · Linux Article Administration · Security & access 15 Oct 2026
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Commitpedia +3,180 chars