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
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026";User altered.CONNECT lab_a/lab_pw_2026@//localhost/FREEPDB1ERROR:
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.SELECT username, account_status FROM dba_users WHERE username = 'LAB_A';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.
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;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
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026";User altered.CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEERROR:
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.COLUMN name FORMAT A12
COLUMN pdb FORMAT A10
SELECT name, pdb FROM v$services ORDER BY name;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.
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';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.
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;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
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026";User altered.CONNECT lab_aa/"Lab_Pw_2026"@//localhost/FREEPDB1ERROR:
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.SELECT username, account_status FROM dba_users WHERE username IN ('LAB_A', 'LAB_AA');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.
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;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
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026";User altered.CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEPDB1 AS SYSDBAERROR:
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.COLUMN username FORMAT A12
SELECT username, sysdba, sysoper FROM v$pwfile_users;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.
COLUMN grantee FORMAT A10
COLUMN privilege FORMAT A16
SELECT grantee, privilege FROM dba_sys_privs WHERE grantee = 'LAB_A' AND privilege = 'CREATE SESSION';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.
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;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
DROP USER IF EXISTS "app_user" CASCADE;
CREATE USER "app_user" IDENTIFIED BY "App_Pw_2026";
GRANT CREATE SESSION TO "app_user";User dropped.
User created.
Grant succeeded.CONNECT app_user/"App_Pw_2026"@//localhost/FREEPDB1ERROR:
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.SELECT username, account_status FROM dba_users WHERE UPPER(username) = 'APP_USER';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.
CONNECT "app_user"/"App_Pw_2026"@//localhost/FREEPDB1
COLUMN login_user FORMAT A12
SELECT user AS login_user FROM dual;LOGIN_USER
------------
app_user
1 row selected.06A database link still uses the old password after the remote user's password was changed
The database link HR_LINK was created with LAB_B's password and worked: SELECT COUNT(*) FROM hr_emp@hr_link returned 2. Then LAB_B's password was changed with ALTER USER, and the same query failed with ORA-01017 followed by ORA-02063: preceding line from HR_LINK.
A database link stores the password given in IDENTIFIED BY when it is created. It does not follow later password changes, so the link keeps logging in with the old one. The ORA-02063 line tells you the login that failed was the one made through the link, not your own session.
Setup
CREATE TABLE hr_emp (emp_id NUMBER PRIMARY KEY, name VARCHAR2(20));
INSERT INTO hr_emp VALUES (1, 'Kim');
INSERT INTO hr_emp VALUES (2, 'Lee');
COMMIT;Table created.
1 row created.
1 row created.
Commit complete.ALTER USER lab_b IDENTIFIED BY "Hr_Pw_2026";
GRANT CREATE DATABASE LINK TO lab_a;User altered.
Grant succeeded.CREATE DATABASE LINK hr_link CONNECT TO lab_b IDENTIFIED BY "Hr_Pw_2026" USING '//localhost/FREEPDB1';
SELECT COUNT(*) AS emp_count FROM hr_emp@hr_link;Database link created.
EMP_COUNT
----------
2
1 row selected.ALTER USER lab_b IDENTIFIED BY "Hr_Pw_2027";User altered.SELECT COUNT(*) AS emp_count FROM hr_emp@hr_link;SELECT COUNT(*) AS emp_count FROM hr_emp@hr_link
*
ERROR at line 1:
ORA-01017: invalid credential or not authorized; logon denied
ORA-02063: preceding line from HR_LINK
Help: https://docs.oracle.com/error-help/db/ora-01017/COLUMN db_link FORMAT A10
COLUMN username FORMAT A10
COLUMN host FORMAT A24
SELECT db_link, username, host FROM user_db_links;DB_LINK USERNAME HOST
---------- ---------- ------------------------
HR_LINK LAB_B //localhost/FREEPDB1
1 row selected.user_db_links shows that HR_LINK logs in as LAB_B to //localhost/FREEPDB1. That is the account whose password you need to check.
DROP DATABASE LINK hr_link;
CREATE DATABASE LINK hr_link CONNECT TO lab_b IDENTIFIED BY "Hr_Pw_2027" USING '//localhost/FREEPDB1';Database link dropped.
Database link created.Drop the link and create it again with the new password. After that, the same query returned 2 again.
SELECT COUNT(*) AS emp_count FROM hr_emp@hr_link; EMP_COUNT
----------
2
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