甲骨文(0X80004005)ORA-12154:TNS:无法解析连接标识符 [英] Oracle (0x80004005)ORA-12154: TNS:could not resolve the connect identifier
问题描述
我试图连接从ASP典型应用的Oracle数据库,但我一直运行到ORA-12154错误。
I'm trying to connect to an oracle db from an ASP classic application, however I keep running into the ORA-12154 error.
-
TNSNAMES.ORA配置正确
TNSNAMES.ORA is configured properly
DBSOURCE.A.B.com =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =(PROTOCOL = TCP)(HOST = C.D.B.com)(PORT = 1231))
)
(CONNECT_DATA =
(SERVICE_NAME = DBSOURCE)
)
)
DBSOURCE.A.B.com = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = C.D.B.com)(PORT = 1231)) ) (CONNECT_DATA = (SERVICE_NAME = DBSOURCE) ) )
我可以TNSPING
I can TNSPING
C:\\ Documents和Settings \\ USERID.A>用tnsping DBSOURCE
C:\Documents and Settings\USERID.A>tnsping DBSOURCE
TNS Ping实用工具为32位Windows:10.2.0.4.0版本 - 生产09-MAR-2
011 9点12分31秒
TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 09-MAR-2 011 09:12:31
版权所有(C)1997年,2007年,甲骨文。保留所有权利。
Copyright (c) 1997, 2007, Oracle. All rights reserved.
用于参数文件:
C:\\ ORACLE \\产品\\ 10.2.0 \\ Client_1上\\网络\\ ADMIN \\ sqlnet.ora中
Used parameter files: C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\sqlnet.ora
用于TNSNAMES适配器来解析别名
试图联系(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)
(HOST = C.D.B.com)(PORT = 1231)))(CONNECT_DATA =(SERVIC
E_NAME = DBSOURCE)))
OK(30毫秒)
Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = C.D.B.com)(PORT = 1231))) (CONNECT_DATA = (SERVIC E_NAME = DBSOURCE))) OK (30 msec)
我可以创建一个ODBC连接,我测试过这是成功的连接。
I can create an ODBC connection and I've tested the connection which is successful.
我检查我的sqlnet.ora文件
I've checked my sqlnet.ora file
NAMES.DEFAULT_DOMAIN = A.B.com
NAMES.DEFAULT_DOMAIN = A.B.com
SQLNET.AUTHENTICATION_SERVICES =(NONE)
SQLNET.AUTHENTICATION_SERVICES= (NONE)
NAMES.DIRECTORY_PATH =(TNSNAMES,EZCONNECT)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
我也检查了TNSNAMES.ORA作为我的系统路径之一。
I've also checked that the TNSNAMES.ORA as one of my system paths.
我可以用sqlplus连接到数据库
I can connect to the DB with SQLPLUS
下面是code抛出误差
Here is the code that throws the error
dim CnnStr
Set Cnn = Server.CreateObject("ADODB.Connection")
CnnStr="Provider=MSDAORA.1;Password=pass;User ID=user;Data Source=DBSOURCE"
Cnn.Open CnnStr
我运行Windows XP专业版32位SP3
I am running windows XP Pro 32bit SP3
我一个同事的机器上测试,这和ASP应用程序有没有问题,我失去了一个配置的地方还是我搞砸我的配置?
I've tested this on a co-workers machine and the asp app has no issues, am I missing a configuration somewhere or did I mess up my config?
感谢大家的帮助!
推荐答案
这似乎所有的设置都被检查,但这里是我的一些故障排除建议:
It seems all the settings have been checked but here is my suggestions for some trouble shooting:
- 如何在IIS下运行的帐户限制?是否有文件的权限读取TNSNAMES?你有没有试图给用户更多的权利。即使本地系统帐户下运行IIS?记得将它放回它的方式。
- 您是确保没有第三方应用程序,例如反病毒或防火墙可能影响/块的访问。 (禁用它们来测试,但不要忘了重新启用:)
(那你最终该如何解决呢?)
(What did you finally do to solve it?)
这篇关于甲骨文(0X80004005)ORA-12154:TNS:无法解析连接标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!