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

Recently when my machine was reimaged all my previous settings were lost. I had real hard time setting up the connection with oracle server from my machine. I installed ODT with ODAC from oracle but something was missing which resulted in “ORA-12154: TNS:could not resolve the connect identifier specified” error message. After reading several blogs I came to know that I have to set the server, host and port details in tnsname.ora file
# alias =
# (DESCRIPTION =
# (ADDRESS = (PROTOCOL = TCP)(HOST = myserver.mycompany.com)(PORT = 1521))
# (CONNECT_DATA =
# (SERVER = DEDICATED)
# (SERVICE_NAME = orcl)
# )
# )

I updated the Host and service name but still something was missing which resulted in the same above error message. After some trial and error methods I was finally able to solve this issue. In the application they were using alias name as datasource in the connection string where as I gave some dummy alias name.
When I finally gave the correct alias name in the tnsname.ora and in the connection string datasource the issue was fixed.

Hope this saves someone’s time.

One thought on “ORA-12154: TNS:could not resolve the connect identifier specified

Leave a Reply

Your email address will not be published. Required fields are marked *