Oracle 23.26PrivilegesLab-verified · 2026-12-01

ORA-01017: invalid credential or not authorized; logon denied

The login was refused: the username and password did not match a user in the database you connected to.

Oracle AI Database 26ai Free 23.26.3.0.0
ORA-01017: invalid credential or not authorized; logon denied

What changed in 26ai error messages →

Jump to a cause

  1. 01The password case does not match
  2. 02Connected to the CDB root instead of the PDB where the user exists
  3. 03A typo in the username
  4. 04Logging in AS SYSDBA with a user that has no SYSDBA privilege
  5. 05The user was created with a quoted lowercase name ("app_user")
  6. 06A database link still uses the old password after the remote user's password was changed

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

ORA-01017 means the database refused the login. Older versions say invalid username/password; logon denied; Oracle 23ai says invalid credential or not authorized; logon denied. The message does not tell you which part was wrong, so check them one by one.

In the lab, the same account logged in fine once the cause was fixed, so the account itself was never the problem. The causes were the password case, the service name (CDB root vs PDB), the username, AS SYSDBA without the SYSDBA privilege, a username created in lowercase with double quotes, and a database link that still used the old password. In 23ai this message stays in English even in Korean and Japanese sessions, because the language is not set until you log in.

01The password case does not match

The password was set with IDENTIFIED BY "Lab_Pw_2026". Logging in with lab_a/lab_pw_2026 gave ORA-01017. Passwords are case-sensitive.

dba_users showed LAB_A as OPEN, so the account was not locked. Logging in with lab_a/"Lab_Pw_2026" worked, and SELECT user FROM dual returned LAB_A.

Setup
Setuprun as system
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026";
OUTPUT
User altered.
Reproducerun as system
CONNECT lab_a/lab_pw_2026@//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.
Check the causerun as system
SELECT username, account_status FROM dba_users WHERE username = 'LAB_A';
OUTPUT
USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
LAB_A                          OPEN

1 row selected.

If the password has mixed case or special characters, put it in double quotes on the SQL*Plus command line, as above.

Fix: run the corrected statementrun as system
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;
✓ SUCCESS
LOGIN_USER
------------
LAB_A

1 row selected.

02Connected to the CDB root instead of the PDB where the user exists

LAB_A is a user in the pluggable database FREEPDB1. Connecting with the right password to //localhost/FREE (the CDB root service) gave ORA-01017, because there is no LAB_A in the root.

Checking from the PDB showed CON_NAME FREEPDB1 and LAB_A OPEN. Connecting to //localhost/FREEPDB1 worked: LAB_A FREEPDB1.

Setup
Setuprun as system
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026";
OUTPUT
User altered.
Reproducerun as system
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREE
✕ 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.
Check the causerun as system
COLUMN name FORMAT A12
COLUMN pdb FORMAT A10
SELECT name, pdb FROM v$services ORDER BY name;
OUTPUT
NAME         PDB
------------ ----------
freepdb1     FREEPDB1

1 row selected.

The service for the pluggable database FREEPDB1 is freepdb1. LAB_A is a user in that PDB, so the connect string must use freepdb1, not the root service FREE.

Checkrun as system
COLUMN con_name FORMAT A12
SELECT SYS_CONTEXT('USERENV', 'CON_NAME') AS con_name FROM dual;
SELECT username, account_status FROM dba_users WHERE username = 'LAB_A';
OUTPUT
CON_NAME
------------
FREEPDB1

1 row selected.


USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
LAB_A                          OPEN

1 row selected.

Check the service name in your connect string or tnsnames.ora. A local user only exists in its own PDB.

After the fixrun as system
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEPDB1
COLUMN con_name FORMAT A12
COLUMN login_user FORMAT A12
SELECT user AS login_user, SYS_CONTEXT('USERENV', 'CON_NAME') AS con_name FROM dual;
✓ SUCCESS
LOGIN_USER   CON_NAME
------------ ------------
LAB_A        FREEPDB1

1 row selected.

03A typo in the username

Logging in as lab_aa with the right password gave ORA-01017. dba_users returned only LAB_A; there is no LAB_AA user. Oracle gives the same message for a wrong username as for a wrong password.

Logging in as lab_a worked.

Setup
Setuprun as system
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026";
OUTPUT
User altered.
Reproducerun as system
CONNECT lab_aa/"Lab_Pw_2026"@//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.
Check the causerun as system
SELECT username, account_status FROM dba_users WHERE username IN ('LAB_A', 'LAB_AA');
OUTPUT
USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
LAB_A                          OPEN

1 row selected.

Because the message is the same, check the username in dba_users before resetting the password.

Fix: run the corrected statementrun as system
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;
✓ SUCCESS
LOGIN_USER
------------
LAB_A

1 row selected.

04Logging in AS SYSDBA with a user that has no SYSDBA privilege

The user name and password were correct, but adding AS SYSDBA to the connect command gave ORA-01017. The "not authorized" part of the new message covers this case: the password is fine, but the user is not allowed to log in with that administrative privilege.

LAB_A has CREATE SESSION. The same connect command without AS SYSDBA worked and returned LAB_A.

Setup
Setuprun as system
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026";
OUTPUT
User altered.
Reproducerun as system
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEPDB1 AS SYSDBA
✕ 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.
Check the causerun as system
COLUMN username FORMAT A12
SELECT username, sysdba, sysoper FROM v$pwfile_users;
OUTPUT
USERNAME     SYSDB SYSOP
------------ ----- -----
SYS          TRUE  TRUE

1 row selected.

v$pwfile_users lists only SYS with SYSDBA TRUE. LAB_A is not there, so it cannot connect AS SYSDBA.

Checkrun as system
COLUMN grantee FORMAT A10
COLUMN privilege FORMAT A16
SELECT grantee, privilege FROM dba_sys_privs WHERE grantee = 'LAB_A' AND privilege = 'CREATE SESSION';
OUTPUT
GRANTEE    PRIVILEGE
---------- ----------------
LAB_A      CREATE SESSION

1 row selected.

For normal work, remove AS SYSDBA (or set Role to Default in SQL Developer). Only users listed in v$pwfile_users with SYSDBA TRUE can log in AS SYSDBA.

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

1 row selected.

05The user was created with a quoted lowercase name ("app_user")

The user was created as CREATE USER "app_user", in double quotes, so its name is stored in lowercase. CONNECT app_user/"App_Pw_2026" failed with ORA-01017 although the password was right: without quotes Oracle turns the username into APP_USER, which does not exist.

dba_users showed the name as app_user (lowercase) and the account OPEN. Connecting with the name in quotes, CONNECT "app_user"/"App_Pw_2026", worked and user returned app_user.

Setup
Setuprun as system
DROP USER IF EXISTS "app_user" CASCADE;
CREATE USER "app_user" IDENTIFIED BY "App_Pw_2026";
GRANT CREATE SESSION TO "app_user";
OUTPUT
User dropped.


User created.


Grant succeeded.
Reproducerun as system
CONNECT app_user/"App_Pw_2026"@//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.
Check the causerun as system
SELECT username, account_status FROM dba_users WHERE UPPER(username) = 'APP_USER';
OUTPUT
USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
APP_USER                       OPEN
app_user                       OPEN

2 rows selected.

Look for lowercase names with WHERE UPPER(username) = ... in dba_users. Quoting the username every time is easy to forget in tools and connection strings, so creating users without quotes (uppercase) avoids the problem.

Fix: run the corrected statementrun as system
CONNECT "app_user"/"App_Pw_2026"@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;
✓ SUCCESS
LOGIN_USER
------------
app_user

1 row selected.

FAQ

What does ORA-01017 invalid username/password; logon denied mean?

The database did not accept the login. The username, the password, or the database (service) you connected to is wrong. Oracle does not say which.

Is ORA-01017 invalid credential or not authorized the same as invalid username/password?

Yes. It is the same error code; Oracle 23ai changed the wording. The causes and checks are the same.

I am sure the password is right. Why ORA-01017?

Check the case of the password, and check that you connect to the PDB where the user exists (for example FREEPDB1) and not to the CDB root. Both gave ORA-01017 with the right password in the lab.

Is the account locked when I get ORA-01017?

No. A locked account gives a different error, ORA-28000. In all three lab cases the account status was OPEN.

Why is the ORA-01017 message in English in my Korean or Japanese environment?

In Oracle 23ai the message was in English in Korean and Japanese sessions too, because it is raised before the session language is set.

The user exists and the password is right. Why ORA-01017?

Check whether the user name is lowercase in dba_users. A user created as CREATE USER "app_user" can only log in with the name in double quotes: CONNECT "app_user"/password.

Why do I get ORA-01017 only when I connect AS SYSDBA?

The user has no SYSDBA privilege. In the test, the same user and password failed with AS SYSDBA and worked without it. v$pwfile_users showed only SYS with SYSDBA TRUE.

Why do I get ORA-01017 with ORA-02063 when I query over a database link?

The login made by the database link failed, not your own login. In the test, the link worked until the remote user's password was changed; then the query gave ORA-01017 and ORA-02063: preceding line from HR_LINK. Recreating the link with the new password fixed it.

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