Oracle ORA-12154:TNS:无法解析服务名称错误? [英] Oracle ORA-12154: TNS: Could not resolve service name Error?

查看:152
本文介绍了Oracle ORA-12154:TNS:无法解析服务名称错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是SQL Server用户.

I am a SQL Server user .

我在一个使用oracle的项目中(我很少使用) 我需要创建一个ODBC连接,以便可以通过MS Access访问一些数据 我的机器上有一个名为oraHome90的应用程序.似乎允许在网络配置实用程序"中配置称为侦听器的内容,我认为还需要完成本地网络服务名称配置". IT支持人员向我提供了此信息,以建立ODBC连接.我尝试了所有我能想到的组合.我可以通过一个成功通过测试以登录"到oracle服务器数据库的测试.当我尝试创建ODBC连接时,出现以下错误:ORA-12154:TNS:无法解析服务名称.

I am on a project that is using oracle (which I rarely use) I need to create an ODBC connection so I can access the some data via MS Access I have a application on my machine called oraHome90. It seems to allow a configuration of something called a listener in a "net configuration utility", I think that a "Local Net Service Name Configuration" needs to also be done. The IT support gave me this information to set up the ODBC connection . I have tried every combination that I can think of. I can get past a test that successfully passes a test to "login" to the oracle server database. When I try to create the ODBC connection I get the following error: ORA-12154: TNS: Could not resolve service name.

假设我想从头开始,并且以下信息应该允许我连接到数据库.....有任何建议或评论吗?注意:最终该项目将有一个网站.ASP页面来查询数据,但是我首先必须证明我可以使用通过MS Access进行的ODBC连接来查看数据

Assuming that I want to start from scratch and the following information is supposed to allow for me to connect to the database….. Any suggestions or comment ? Note: ultimately the project will have a website .ASP page query the data, but I have to first prove that I can see the data using the ODBC connection via MS Access

Service name: SERVICENAME
HOST = HOST.XYZi.com
User Id: MYUSERID
Password: MYPASSWORD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'Oracle Connection
Dim ocst
Dim oconn

ocst = "Provider=OraOLEDB.Oracle;" & _ 
        "Data Source=DATASOURCE;" & _ 
        "User ID=CHIJXL;" & _ 
        "Password=password;" 

set oconn = CreateObject("ADODB.Connection")

推荐答案

来自 http://ora-12154 .ora-code.com

ORA-12154 :TNS:无法解析指定的连接标识符
原因:使用连接标识符请求与数据库或其他服务的连接,并且使用配置的一种命名方法无法将指定的连接标识符解析为连接描述符.例如,如果使用的连接标识符的类型是网络服务名称,则在命名方法存储库中找不到网络服务名称,或者找不到或访问该存储库.
动作:

ORA-12154: TNS:could not resolve the connect identifier specified
Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.
Action:

  • 如果使用的是本地命名(TNSNAMES.ORA文件):

  • If you are using local naming (TNSNAMES.ORA file):

确保在Oracle Net概要文件(SQLNET.ORA)中将"TNSNAMES"列为NAMES.DIRECTORY_PATH参数的值之一.

Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)

验证TNSNAMES.ORA文件存在并且位于正确的目录中并且可以访问.

Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.

检查TNSNAMES.ORA文件中是否存在用作连接标识符的网络服务名称.

Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.

确保TNSNAMES.ORA文件中的任何地方都没有语法错误.查找不匹配的括号或流浪字符. TNSNAMES.ORA文件中的错误可能使其无法使用.

Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.

如果使用目录命名:

验证"LDAP"是否已列为Oracle Net概要文件(SQLNET.ORA)中NAMES.DIRETORY_PATH参数的值之一.

Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

验证LDAP目录服务器已启动并且可以访问.

Verify that the LDAP directory server is up and that it is accessible.

验证是否在目录中配置了用作连接标识符的网络服务名称或数据库名称.

Verify that the net service name or database name used as the connect identifier is configured in the directory.

通过指定标准的网络服务名称或完整的LDAP DN作为连接标识符来验证所使用的默认上下文是否正确

Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier

如果使用的是简单连接命名:

If you are using easy connect naming:

验证"EZCONNECT"是否已列为Oracle Net概要文件(SQLNET.ORA)中NAMES.DIRETORY_PATH参数的值之一.

Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

确保指定的主机,端口和服务名称正确.

Make sure the host, port and service name specified are correct.

尝试将连接标识符括在引号中.有关命名的更多信息,请参见《 Oracle Net Services管理员指南》或《 Oracle操作系统特定指南》.

Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.

这篇关于Oracle ORA-12154:TNS:无法解析服务名称错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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