TNS,当两个不同版本安装在一起时无法处理服务名称
在我们的服务器中,我们发布了一个asp.net应用程序,它使用oracle11g作为数据库。
我们只需在 web.config 中设置连接字符串,就可以了。
然而,有人在同一台服务器上安装了 oracle8,因为他们在其他客户端应用程序中需要它们。
但之后,我们的网络应用程序无法运行,我们收到错误:
ora-12154 TNS 无法处理服务名称
然后我发现路径环境已经改变了。首先添加“C:/app/oracle81/bin”。但即使我先更改“D:/app/oracle11g/bin”,它也不起作用。
有什么想法可以让两者都工作吗?
In our server,we publish a asp.net application,which use the oracle11g as the database.
We just set the connection string in the web.config,it works.
However someone install the oracle8 in the same server since they need them in other client application.
But after that,our web applcation can not work,we get the error:
ora-12154 TNS an not handle the service name
Then I found that the path environment has been changed. The "C:/app/oracle81/bin" is added at first. But even I change the "D:/app/oracle11g/bin" first,it does not work also.
Any idea to make the both work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能会调查 .NET 中使用的驱动程序... Microsoft 已弃用的 Oracle 提供程序或 Oracle 自己的提供程序或位于 DSN 中几种可能的驱动程序之上的某种 ODBC 提供程序。每个问题都可以通过不同的方式进行补救。
但听起来 Oracle 8 安装在某种程度上已经超越了 Oracle 11 安装,而不仅仅是“PATH”环境变量。我的猜测是注册表。
按照不便性和有效性的升序排列,您可以尝试:
1) 运行 Oracle 11 安装程序并查看它是否了解 Oracle 8 主目录。 (如果是8.0则不太可能)。将其设置为默认值或列表顶部;出口;然后返回并将 Oracle 11 设置为默认/列表顶部。
2) 在 Oracle 8 主目录中配置 TNS 条目以连接到 Oracle 11 数据库。接受这样一个事实:您使用的是非常过时的客户端。
3)卸载并重新安装Oracle 11以使其抢回优先级。
You might investigate what drivers are being used within .NET ... Microsoft's deprecated Oracle provider or Oracle's own provider or some kind of ODBC provider sitting on top of several kinds of possible drivers in a DSN. Each might be remedied in a different way.
But it sounds like the Oracle 8 installation has stolen priority over the Oracle 11 installation in some way that is not just the "PATH" environment variable. My guess would be the registry.
In ascending order of inconvenience and effectiveness you could try:
1) Run the Oracle 11 installer and see if it knows about the Oracle 8 home. (Unlikely if it's 8.0). Set it as default or top of the list; exit; then go back and set Oracle 11 as the default/top of the list.
2) Configure the TNS entries in your Oracle 8 home to connect to your Oracle 11 database. Live with the fact you're using a very out of date client.
3) Uninstall and reinstall Oracle 11 to get it to steal back the priority.
默认情况下,.net 框架使用路径语句中出现的第一个 oracle 目录。关于如何解决这个问题已经有一些讨论 - 但最好的选择是每台机器运行一个客户端。
By default the .net framework uses the FIRST oracle directory it comes to the in the path statement. There have been some discussions on how to get around this - but your best bet is to run one client per machine.