ORA-12154: TNS:could not resolve the connect ident

2019-05-14 06:10发布

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!

2条回答
时光不老,我们不散
2楼-- · 2019-05-14 06:32

I faced this error today. Spent a lot of time checking what I did wrong while configuring listener. Even after I configured it using netca I still had the same error:

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

It appeared that the cause was bad password for sys containing '@' character.

For example when you connect as below:

$sqlplus sys as sysdba

The response is

SQL*Plus: Release 11.2.0.4.0 Production on Wed May 27 08:24:19 2015

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter password: ple@se ERROR: ORA-12154: TNS:could not resolve the connect identifier specified

That is it. Very easy case.

查看更多
The star\"
3楼-- · 2019-05-14 06:45

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.

查看更多
登录 后发表回答