甲骨文ORA-12154错误本地IIS,但不与Visual Studio开发服务器 [英] Oracle ORA-12154 error on local IIS, but not with Visual Studio Development Server

查看:208
本文介绍了甲骨文ORA-12154错误本地IIS,但不与Visual Studio开发服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有当它由Visual Studio开发服务器启动,可以连接到Oracle ASP.NET应用程序,但是当我将其部署到我的本地IIS,它不连接,显示ORA-12154:TNS:无法解析指定的连接标识符的错误。

I've got an ASP.NET application that can connect to Oracle when it's started by Visual Studio Development Server, but when I deploy it to my local IIS, it does not connect, showing the "ORA-12154: TNS:could not resolve the connect identifier specified" error.

我的连接字符串是:

Data Source=ABC; User Id=USER; Password=PASSWORD;

TT的使用TNS。我的tnsnames.ora位于C:\\ ORACLE \\ instantclient_10_2 \\网络\\管理员,我的ORACLE_HOME系统变量指向C:\\ ORACLE \\ instantclient_10_2

Tt's using TNS. My tnsnames.ora is located at C:\oracle\instantclient_10_2\network\admin, and my ORACLE_HOME system variable is pointing to C:\oracle\instantclient_10_2.

要使它工作,我改变了连接字符串:

To make it work, I changed the connection string to:

"SERVER=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = server1.theplaceiwork.com)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = server2.theplaceiwork.com)(PORT = 1521))(LOAD_BALANCE = yes))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ABC)(FAILOVER_MODE =(TYPE = SELECT)(METHOD = BASIC))));uid=USER;pwd=PASSWORD;"

所以TNS是不再使用。

So TNS is used no longer.

不过,我想知道为什么我可以连接使用TNS而与Visual Studio debbuging,但使用IIS我可不敢当。

But I'd like to know why I can connect using TNS while debbuging with Visual Studio, but when using IIS I can't.

任何提示?

PS。我可以使用的SQLDeveloper与TNS没有显示出连接错误。

PS. I can use SqlDeveloper with TNS showing no connection errors.

感谢

推荐答案

请确保网络服务对您的TNS目录的访问或更改应用程序池为您运行。

Make sure Network Service has access to your TNS directories or change your App Pool to run as you.

这篇关于甲骨文ORA-12154错误本地IIS,但不与Visual Studio开发服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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