ORACLE TNS NAMES没有解决 [英] ORACLE TNS NAMES not resolving

查看:222
本文介绍了ORACLE TNS NAMES没有解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想知道是否有人可以帮助我。我一直收到错误ORA-12154:TNS无法解析连接标识符。我安装了从oracle下载的oracle即时客户端和odbc连接。操作系统是Windows 7 64位。据我所知,没有必要为连接安装一个实际的oracle主页。但每当我尝试通过visual studio 2010连接到数据库时,我都会收到ORA-12154:TNS:无法解析指定的连接标识符。我无法解决这个问题,因为我找不到tnsnames.ora或者listener.ora文件。

任何帮助都将不胜感激

谢谢

Kallie

解决方案

Hello Kallie,



Oracle Instant Client实际上并不需要TNS配置(tnsnames.ora)。根据文档,Instant Client允许您在不安装标准Oracle客户端或拥有ORACLE_HOME的情况下运行应用程序。所以它确实使用了稍微不同的连接字符串语法。您可以对即时客户端使用以下任何一种语法。



  • 表格的SQL Connect URL字符串:

     // host:[port] [/ service name] 

    eg //oradb01.foo.com:1521/orcl

  • 作为Oracle Net关键字 - 值对。

    (DESCRIPTION =(ADDRESS =(PROTOCOL = tcp)(HOST = HOSTNAME_OR_IP)
    (PORT = 1521))
    (CONNECT_DATA =(SERVICE_NAME = SERVICE_NAME)))

    例如
    (DESCRIPTION =(ADDRESS =(PROTOCOL = tcp)(HOST = oradb01.foo.com)
    (PORT = 1521))
    (CONNECT_DATA =(SERVICE_NAME = orcl)))



根据文档,如果设置了TNS_ADMIN环境变量,则需要TNS_ADMIN查找配置文件的命名方法继续有效。如果未设置TNS_ADMIN环境变量,并且使用了TNSNAMES条目,则必须设置ORACLE_HOME变量,并且配置文件应位于


ORACLE_HOME / network / admin目录中。



问候,


我安装了Oracle 10g express并复制了现有的工作tns名称和监听器文件,它完美运行

Hi,

i wonder if anyone can assist me. i keep getting an error ORA-12154: TNS Could not resolve the connection identifier. i installed the oracle instant client and odbc connections downloaded from oracle. the OS is windows 7 64 bit. as i understand it is not necessary to install an actual oracle home for the connections. but whenever i try to connect to the database via visual studio 2010 i get the ORA-12154: TNS: Could not resolve the connection identifier specified. i am at a loss at what i am need to do to fix this as i can't find the tnsnames.ora or the listener.ora file .
any help will be greatly appreciated
thank you
Kallie

解决方案

Hello Kallie,

Oracle Instant Client does not really requires the TNS configuration (tnsnames.ora). According to documentation Instant Client allows you to run your applications without installing the standard Oracle client or having an ORACLE_HOME. So it does uses a slightly different connection string syntax. You can use any one of the following syntax with the instant client.

  • A SQL Connect URL string of the form:

    //host:[port][/service name]
    
    e.g. //oradb01.foo.com:1521/orcl

  • As an Oracle Net keyword-value pair.

    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=HOSTNAME_OR_IP) 
    (PORT=1521)) 
    (CONNECT_DATA=(SERVICE_NAME=SERVICE_NAME))) 
    
    e.g.
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=oradb01.foo.com) 
    (PORT=1521)) 
    (CONNECT_DATA=(SERVICE_NAME=orcl)))


As per the documentation Naming methods that require TNS_ADMIN to locate configuration files continue to work if the TNS_ADMIN environment variable is set. If the TNS_ADMIN environment variable is not set, and TNSNAMES entries are used, then the ORACLE_HOME variable must be set, and the configuration files are expected to be in the


ORACLE_HOME/network/admin directory.

Regards,


hi i installed Oracle 10g express and copied the existing working tns names and listeners files and it works perfectly


这篇关于ORACLE TNS NAMES没有解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆