The user name is right, the password is right, and Oracle still says ORA-01017: invalid credential or not authorized; logon denied. On 12c and later multitenant databases, a common reason is that you connected to the CDB root instead of the PDB where the user lives.
I reproduced it on Oracle AI Database 26ai Free (23.26.3) and walked through checking and fixing it. Every output below is real SQL*Plus output.
Setup
LAB_A is a local user in the pluggable database FREEPDB1. Set its password first.
ALTER USER lab_a IDENTIFIED BY "Lab_Pw_2026"; User altered. Reproduce: connect through service FREE (the CDB root)
CONNECT lab_a/"Lab_Pw_2026"@//localhost/FREE 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. Same password that was just set, and still ORA-01017.
Check 1: which service goes to the PDB
From inside the PDB (FREEPDB1), list the services and the PDB each one opens.
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 FREEPDB1 is freepdb1. The FREE service used above belongs to the root (CDB$ROOT).
Check 2: the user exists in the PDB and is not locked
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. LAB_A exists in FREEPDB1 with status OPEN. A local user only exists inside its own PDB, so in the root there is no such user, and the logon fails with ORA-01017.
Fix: connect with the PDB service name
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. Same user, same password, different service, and the login works.
Takeaways
- ORA-01017 is not only a wrong password. It also appears when the user does not exist where you connected
- In a multitenant database, local users live only inside their PDB. The root service (for example
FREE) cannot see them - The
pdbcolumn ofv$servicesshows which service name opens which PDB - Check that the
SERVICE_NAMEin your connect string or tnsnames.ora points to the PDB service
Other causes of ORA-01017 (password case, a typo in the user name, AS SYSDBA without the privilege, a lowercase user created with double quotes) are on this page, each reproduced, checked, and fixed on a real database:
https://errorfixlab.96ssg.com/en/ora-01017/
This article was written with the help of generative AI, based on output actually run in a test environment.