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

来源:互联网 发布:淘宝秒杀之如来神掌 编辑:程序博客网 时间:2024/05/17 02:52

错误描述:

 在进行ADG实验当中发现本地db服务器不能使用listener.ora文件中的服务名进行登录,命令如下:

[oracle@dba1 admin]$ sqlplus  sys/oracle@dba1:1521/BEIJING_DGMGRL as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 26 17:15:38 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


问题分析:

 本以为是服务名区分大小写或者服务名设置错误,后经过测试都排除了。最后经过网友的指点才发现原来是sqlnet.ora文件设置问题。


解决方法:

默认sqlnet.ora 文件中 “NAMES.DIRECTORY_PATH= (TNSNAMES)”,后设置成“NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT)”解决,增加了参数‘EZCONNECT’ 问题解决了。


[oracle@dba1 admin]$ cat sqlnet.ora 
# sqlnet.ora Network Configuration File: /u01/oracle/product/11.2.0.4/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
ADR_BASE = /u01/oracle


[oracle@dba1 admin]$ sqlplus  sys/oracle@dba1:1521/BEIJING_DGMGRL as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 26 17:43:39 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> 


小结:

oracle要学习的东西还非常的多,一个非常小的细节让我困感的很长时间,许多东西还是要注意细节。

====================================================================================

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任! 谢谢合作!

QQ:164798858@qq.com

Sina:Weibo.com/kaijunfeng

Gmail:Kaijunfeng@gmail.com


0 0
原创粉丝点击