ORA-01017: invalid username/password; logon denied
Oracle rejected the login: wrong user name or password, a case-sensitive password typed in the wrong case, or the wrong database or PDB.
- Error code
ORA-01017- Category
- Connection and login
What it means
ORA-01017 means the database didn't accept the credentials. Since Oracle 11g passwords are case-sensitive by default, and in a multitenant database a common user and a local PDB user are different accounts, so connecting to the wrong service can look like a wrong password.
Newer releases word it as invalid credential or not authorized; logon denied.
Common causes
- Wrong password, or the right password in the wrong case.
- Connecting to the container database (CDB) instead of the PDB where the user lives, or the reverse.
- An older client that can't use the password verifier the account has (for example an account with only 12C verifiers and a very old client).
- Special characters in the password mangled by the shell or connection string; quote the password.
- Operating-system authentication (
/ as sysdba) failing because the OS user isn't in the right group.
How to fix it
-
Check that the account exists in the database you are connecting to, and its status.
SELECT username, account_status, authentication_type FROM dba_users WHERE username = 'APP_USER';
-
Reset the password as an administrator. Quote it to keep the exact case and special characters.
ALTER USER app_user IDENTIFIED BY "N3w-Strong-Pass";
-
Make sure the connect string names the right service: the PDB service, not the CDB, for a local user.
-
In SQL*Plus, quote passwords with special characters:
sqlplus app_user/\"p@ss\"@//db-host:1521/salespdb.
Related errors
ORA-28000the account is lockedORA-28001the password has expiredORA-12154TNS: could not resolve the connect identifierORA-01031insufficient privileges18456SQL Server: Login failed for user28P01PostgreSQL: password authentication failed1045MySQL: Access denied for user
More connection and login errors
ORA-12514TNS: listener doesn't know the requested serviceORA-12505TNS: listener doesn't know the SIDORA-12541TNS: no listenerORA-12170TNS: connect timeout occurredORA-03113end-of-file on communication channelORA-03135connection lost contactORA-01034ORACLE not availableORA-27101shared memory realm does not exist
The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.
Work on Oracle in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.