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: January 21, 2021 - 9:06 am UTC

Version: 19c

Viewed 1000+ times

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 we 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

  (1 rating)

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.

More to Explore

Administration

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