Oracle 10g ORA-12154: TNS: could not resolve the connect identifier specified 问题解决!

    今天,从上周就捆饶我的问题终于在下班前被我搞定!小得意了一下.
    我的电脑上之前安装了Oracle 10g database,配置完变量用PL/SQL操作一切OK .当又安装完Oracle 10g client后,问题出现了,用PL/SQL登陆时反复提示:ORA-12154: TNS: could not resolve the connect identifier specified
    对于初学者,我反复的在"Oracle - OraDb10g_home3"下的"配置和移植工具"中的"Net Manager"中查找问题所在.请教高手,也没有召见问题的原因.我郁闷了,随后自己决定来搞定这个问题.
    我做了大量的反复的资料查看和自我检查,灵感在下班的时候出现,我突然意识到我的"环境变量"一直被忽视.
打开后我发现我当前的环境变量这样设置的:
path  ==  E:/oraclient_2;E:/oracle/oradata/bin;E:/oracle/bin;E:/Program Files/Java/jdk1.5.0_04/bin;E:/Tomcat5028/bin;%SystemRoot%/system32;%SystemRoot%;%SystemRoot%/System32/Wbem
问题出现了.随后我该成如下:
path  ==  E:/oracle;E:/oracle/oradata/bin;E:/oracle/bin;E:/Program Files/Java/jdk1.5.0_04/bin;E:/Tomcat5028/bin;%SystemRoot%/system32;%SystemRoot%;%SystemRoot%/System32/Wbem

OK !!! 问题在最后的关头被我解决了!!!不错.
这就是: "不抛弃 不放弃"

 

 

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

The error also appears in some versions as: “ORA-12154: TNS:could not resolve service name.”

When a program needs to connect to an Oracle service via Oracle Networking (SQL*Net), it must look up the connect data for that service somewhere. When the lookup fails, the Oracle client code raises ORA-12154. Most people will encounter this error when their application tries to connect to an Oracle database service, but it can also be raised by one database instance trying to connect to another database service via a database link.

Note that this error is generated by the Oracle client code on the local host where the program is running, not by the remote Oracle service to which you are attempting to connect.

There are a few ways that the Oracle client code can look up connect data:

  • A flat file named tnsnames.ora
  • Oracle Names service
  • LDAP

If you see the whole ORA-12154 error with the text, then your program is finding a working Oracle client install, but that the Oracle service as specified is not listed in tnsnames.ora, Oracle Names or LDAP. The most common causes of ORA-12154 are:

  • The entry is missing from tnsnames.ora
  • The entry in tnsnames.ora is malformed
  • The program is using tnsnames.ora from the wrong ORACLE_HOME
  • The program is not using a fully-qualified service name, but no default domain is enabled in sqlnet.ora

Most sites use tnsnames.ora, but enough use Oracle Names and LDAP that the first step should be to determine which name resolution method is deployed at your site. If you are not the database administrator, you should get in touch with the people who manage your Oracle systems and find out which method you should be using. Often they will be able to provide guidance for resolving your problem in accordance with your site’s standards.

The client code decides which mechanism to use based on the file sqlnet.ora. This and tnsnames can usually both be found in the Oracle install directory (“ORACLE_HOME”), under network/admin/. This location may be overridden with the environment variable TNS_ADMIN. If the sqlnet.ora file does not exist, or does not specify a resolution method, then Oracle Net uses tnsnames.ora.

Example locations of Oracle networking files:

Windows:

ORANT/NET80/ADMIN/
ORACLE/ORA81/NETWORK/ADMIN/
ORAWIN95/NETWORK/ADMIN/
ORAWIN/NETWORK/ADMIN/

UNIX / Linux:

$ORACLE_HOME/network/admin/
/etc/
/var/opt/oracle/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值