Skip to content
Advertisement

Error: ORA-12154: TNS:could not resolve the connect identifier specified when entering username and password in sql plus

I’m trying to login to my oracle database using sql plus. But such error out

ORA-12154: TNS:could not resolve the connect identifier specified

here is my tnsnames.ora file, sqlnet.ora file and listener.ora file. It is because of i use symbol ‘@’ in my password or what. I still cant find any solution from stackoverflow. I hope someone can help me with this. I show you how i do it in sql plus.

For your information, I’m just a student that just learn how to setup oracle database.

Advertisement

Answer

You did not show your actual sqlplus connect command. But since you asked about ‘@’ in your password, absolutely this can and most often will cause the exact error you mention. The ‘@’ is used as a delimiter to mark the beginning of the net service name (tnsnames entry). For instance:

In this example, it will see the ‘@’ in my password and assume that the password is actually ‘myp’ and it is to look for a tnsnames.ora entry of ‘ssword’

Bottom line, your password verification function should disallow ‘@’.

But also note that in this example, you are connecting ‘as sysdba’. For this you really don’t need any credentials at all, as you should be using an OS account that is a member of the ‘dba’ group, and thus can connect with os credentials:

But then, you really never should connect as SYS unless you absolutely need that elevated level of access. When you are SYS you are juggling chainsaws on a high-wire without a net.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement