Skip to Main Content
  • Questions
  • Unable to connect to PDB ORA-01017: invalid username/password; logon denied

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Peter.

Asked: September 30, 2020 - 12:02 pm UTC

Last updated: March 08, 2024 - 6:00 pm UTC

Version: 19c

Viewed 10K+ times! This question is

You Asked

Dear Tom,

I'm trying to connect my pdb - pdb1, using tnsnames.ora. I have granted tom dba privs just for testing purpose.

My database name/CDB name - TEST
My pdb name - pdb1

sqlplus tom/tom@pdb1
ERROR:
ORA-01017: invalid username/password; logon denied


Here's output from v$services;

Select name,pdb from v$services;

NAME PDB
---- -----
pdb1 PDB1


Here's My tnsnames.ora

PDB1 =
(DESCRIPTION =
(ADDRESS LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = myhost) PORT = 1521))
)
(CONNECT DATA =
(SERVER = DEDICATED)
(SERVICE NAME = pdb1)
)
)


I'm manually writing this code from my phone here, but pls know that I can successfully tnsping to it.

Also, I can see service pdb1 has 1 instance. instance test .....in lsnrctl services output.

I have even tried capitalising the service name in tns entry, it didn't work.

Thanks for all the questions you have answered !!!

You and team are awesome.

Regards,
Peter

and Chris said...

You're connecting to the database just fine, the problem is here:

ORA-01017: invalid username/password; logon denied


There is no user tom with the password tom!

You need a valid username + password combination.

Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

ORA-01017:invalid username/password; logon denied in 19C PDB

Rajeeva, January 21, 2021 - 5:01 am UTC

Hi,

When I do:
sqlplus scott/tiger
I get:
ORA-01017: invalid username/password; logon denied

I know SCOTT exist with the password tiger. I even changed the password (as sys) couple of times.
When I lock the account SQL*plus tells me the account is locked. When I unlock the account and try to login I still get the ORA-01017 error.

I am on 19.5C, This is on the CDB. I have the same problem in the PDB also.

Please any help is appreciated.
Chris Saxon
January 21, 2021 - 9:06 am UTC

Things to check:

- Does SCOTT exist in the PDB you're connecting to?
- Have you changed the password in the PDB you're connecting to?
- Have you got the correct case for the password?

You should connect to PDBs for general use - this includes user management. Reserve CDB for admin functions like creating/cloning/dropping PDBs.

ora-1017 pdb

Fernanda Afonso, October 16, 2023 - 3:16 pm UTC

I have the same problem...and with system and service pdb I got it !
When new user, the error ora-1017 appears.
Connor McDonald
October 16, 2023 - 11:17 pm UTC

Remember there are two things here in multitenant

a) a COMMON user, one that exists in the CDB and can be accessed there and in all of the PDBs as well. SYSTEM is example of such

b) a LOCAL user. Exists only in a nominated PDB

For example, if you create SCOTT in a PDB then you will NOT be able to connect as SCOTT in the CDB (or in any other PDB that exists).

Hence

sqlplus scott/tiger will NOT work, because (by default) its trying the CDB

sqlplus scott/tiger@MYPDB will work ( assuming it was MYPDB you created the user in)

A reader, November 12, 2023 - 4:47 pm UTC

Most likely you created the user in lowercase. Recreate the user in uppercase.
Chris Saxon
November 13, 2023 - 3:12 pm UTC

Yep, that's possible. Recreating a user is often tricky though; wrapping the name in double quotes may be easier if this is the case.

Prakash, March 08, 2024 - 7:38 am UTC

ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = TRUE;

please set this parameter to TRUE, issue will be resloved.
Chris Saxon
March 08, 2024 - 6:00 pm UTC

Please don't. It's been desupported in 21c.

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database