// Oracle error reference

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
Error message
invalid username/password; logon denied

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

  1. 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';
  2. 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";
  3. Make sure the connect string names the right service: the PDB service, not the CDB, for a local user.

  4. In SQL*Plus, quote passwords with special characters: sqlplus app_user/\"p@ss\"@//db-host:1521/salespdb.

Related errors

More connection and login errors

The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.

// fewer errors, faster fixes

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.