Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

The issue started when i installed the server version with already existing client version of Oracle 10g.

Background : The Oracle client version 10g was installed (at c:/oracle) to connect to a database residing in other country. So we can just connect to it and have limited access to it.

Path => c:/oracle/ora_client/network/admin/listener.ora

So to work as admin I installed 10g server at the same location c:/oracle on windows. I can now work as server.

Path => c:/oracle/product/db_1/network/admin/listener.ora

But the issue arises when I try to connect with my application installed to setup connection as a client (to server residing in other country), it fails and throws an error ORA-12154.

So, do I have to uninstall my server version (just in case the confusion might have arrived due to the presence of two Oracle databases)?

How can I fix it? What has been the probable cause for it? Please advise!

like image 669
ErAB Avatar asked Jan 18 '23 20:01

ErAB


1 Answers

When you installed the server version it updated the environment variables to point to the server installation and not the client installation. The definition of TNS aliases is done in tnsnames.ora and no the listener.ora. So you would have to copy the already existing entries from c:/oracle/ora_client/network/admin/tnsnames.ora to c:/oracle/product/db_1/network/admin/tnsnames.ora. Be careful that you obey the tnsnames.ora format.

like image 176
steve Avatar answered Jan 31 '23 08:01

steve