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

 注册表:regedit

安装oracle后用Net Manager 配置好服务名称之后,测试成功,可是PL/SQL无法连接

 

http://wenku.baidu.com/link?url=M3fK-v4OFeIx1mAWotKoPMKagYjZt0yMQ2ZPyZrN0DF7ID1_IiPB0BUNHS4vw80wTsGkWuNZiqH7wm_4k5SHTTvhe3gwJptpvMq49po5Y3q

Oracle:ORA-12154: TNS:could not resolve the connect identifier specified_第1张图片

 Oracle:ORA-12154: TNS:could not resolve the connect identifier specified_第2张图片

 参考上面网址找到环境变量发现确实存在 C:\oracle\product\10.2.0\client_1; 移除此段即可,

 

导致改问题的原因是:装oracle的时候装了两遍,第一遍装错了。

 

C:\oracle\product\10.2.0\client_2\NETWORK\ADMIN\tnsnames.ora

Oracle:ORA-12154: TNS:could not resolve the connect identifier specified_第3张图片

 ====================================================================win7 64位 vs2010 oracle ORA-12154: TNS: 无法解析指定的连接标识符

原因:win7 X64位电脑。在安装oracle的时候 有一部分文件安装到了 Program Files(X66)的文件夹内 就是这个 括号 引起的这个错误。当用VS2010直接运行程序的时候是VS直接开的端口去运行程序,因为连接oracle调用到了Program Files(X66)\Oracle下的程序。所以导致了该错误。

如果直接将VS调试通过发布在IIS上,那么就不会出现这样的问题了。!!!!!!!

可以参考这个文章:http://www.cnblogs.com/cnluoke/archive/2008/01/17/1042183.html

ORA-12154: TNS: 无法解析指定的连接标识符

 Oracle:ORA-12154: TNS:could not resolve the connect identifier specified_第4张图片

C:\oracle\product\10.2.0\client_2\NETWORK\ADMIN\tnsnames.ora

C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN

# tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\client_2\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.

HBAMS =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.0.251)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = hbAMS)
    )
  )

HBCQ =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.3.227)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = hbcq)
    )
  )

HBJN =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.0.251)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = hbjn)
    )
  )

HBPZ =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.0.251)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = hbpz)
    )
  )
tnsnames.ora

 ORA-12154: TNS: 无法解析指定的连接标识符

可以搜索关键字: 关于win7 x64 连接oracle 客户端 VS2010调试 提示“ORA-12154: TNS: 无法解析指定的连接标识符 ”

http://davidullua.cnblogs.com/articles/180792.html

最终解决方法:

http://blog.miniasp.com/post/2009/08/31/Solve-ASPNET-cannot-connect-Oracle-DB-using-Development-Server.aspx

http://blog.sina.com.cn/s/blog_6d0021460101545s.html

http://blog.sina.com.cn/s/blog_92400273010190um.html

 

Oracle:ORA-12154: TNS:could not resolve the connect identifier specified_第5张图片

TNS_ADMIN

C:\app\cq\product\11.2.0\dbhome_1\NETWORK\ADMIN

别忘了 重启IIS 哎本来是设置成功的。忘了重启了 试了好几遍

 

 

 

 

你可能感兴趣的:(ORA-12154)