tnsping 失败,但可以通过 sqlplus 连接到 Oracle DB
我已在 Windows XP 计算机上安装了 Oracle Client v. 11.2.0.1 并设置了 TNS_ADMIN 和 ORACLE_HOME 环境变量。
使用 sqlplus 通过 TNS 别名连接到远程数据库工作正常:
sqlplus username/password@ALIAS
但是 tnsping 到同一别名会导致以下错误:
P:\>tnsping ALIAS
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 07-AUG-2
011 18:20:08
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Message 3511 not found; No message file for product=NETWORK, facility=TNSMessage
3512 not found; No message file for product=NETWORK, facility=TNSMessage 3513 n
ot found; No message file for product=NETWORK, facility=TNSMessage 3509 not foun
d; No message file for product=NETWORK, facility=TNS
对于类似问题(即在 Stack Overflow 上此处),tnsping 至少能够从别名解析连接字符串。在这种情况下并非如此。这让我相信某些环境变量丢失或指向错误的位置。任何建议将不胜感激。
I've installed the Oracle Client v. 11.2.0.1 on a Windows XP machine and set both the TNS_ADMIN and ORACLE_HOME environment variables.
Using sqlplus to connect to a remote database via a TNS alias works fine:
sqlplus username/password@ALIAS
But a tnsping to the same alias results in the following error:
P:\>tnsping ALIAS
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 07-AUG-2
011 18:20:08
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Message 3511 not found; No message file for product=NETWORK, facility=TNSMessage
3512 not found; No message file for product=NETWORK, facility=TNSMessage 3513 n
ot found; No message file for product=NETWORK, facility=TNSMessage 3509 not foun
d; No message file for product=NETWORK, facility=TNS
For similar problems (i.e. on Stack Overflow here), tnsping is at least able to resolve the connection string from the alias. Not so in this case. This leads me to believe that some environment variable is missing or pointing to the wrong location. Any suggestions would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我尝试过仅自定义安装 ODBC 驱动程序和 SQL Developer,但遇到了这个问题。 SQL Developer 可以正常连接,但 tnsping 会产生 3511 错误。从另一个安装复制 mesg 文件会产生 3505 错误。
安装管理员选项对我有用。
I had tried Custom installing just the ODBC drivers and SQL Developer, and ran into this problem. SQL Developer would connect just fine, but tnsping would produce the 3511 error. Copying mesg files from another installation produced a 3505 error.
Installing the Administrator option worked for me.
问题是您没有正确安装该产品。它找不到其消息文件,因此您看不到结果。 TNS-3509 表示 tnsping 成功。
The problem is that you haven't installed the product correctly. It cannot find its message files, therefore you don't see the results. TNS-3509 means that the tnsping succeeded.