在 ASP.NET 上使用 Oracle Instant Client。出现 ORA-12154 或 12545 错误
我已经部署了一个 Web 服务,并且正在使用 bin 文件夹中的 Oracle Instant Client 实例。问题是,无论我在测试服务器上使用什么连接字符串,我都会收到 ORA-12154 错误或 ORA-12545 错误。
这是我尝试过的连接字符串:
//This one caused the ORA-12545 error:
<add key="oracleConnectString" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost.mydomain.com)(PORT=1574)))(CONNECT_DATA=(SID=mysid)(SERVER=DEDICATED)));User Id=username;Password=password;" />
//These caused the ORA-12154 errors:
<add key="oracleConnectString" value="Data Source=username/password@//myhost.mydomain.com:1574/mysid;"/>
or
<add key="oracleConnectString" value="Data Source=myhost.mydomain.com:1574/mysid;User Id=username;Password=password;"/>
我尝试在系统中设置 TNS_ADMIN 变量,但这对我没有任何作用。当然,在我的机器上一切正常。只是不在部署的服务器上。
I have a web service that I have deployed and am using an Oracle Instant Client instance in the bin folder. The problem is, no matter what connection string I use on a Testing Server, i get a ORA-12154 error or a ORA-12545 error.
Here's the connection string's I've tried:
//This one caused the ORA-12545 error:
<add key="oracleConnectString" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost.mydomain.com)(PORT=1574)))(CONNECT_DATA=(SID=mysid)(SERVER=DEDICATED)));User Id=username;Password=password;" />
//These caused the ORA-12154 errors:
<add key="oracleConnectString" value="Data Source=username/password@//myhost.mydomain.com:1574/mysid;"/>
or
<add key="oracleConnectString" value="Data Source=myhost.mydomain.com:1574/mysid;User Id=username;Password=password;"/>
I've tried setting up TNS_ADMIN variables in the system and that did nothing for me. Of course, everything works fine on my machine. Just not on the deployed server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能已经解决了这个问题,但是您是否执行了以下操作
将以下 dll 从 ODAC 文件夹复制到 bin(如果是 Web)或 exe 的位置文件
我创建了一篇博客文章,介绍了步骤以及示例应用程序的链接。
you may have already solved this issue but did you do the following
Copy the following dll’s from the ODAC folder to either the bin (if web) or location of the exe file
I created a blog post that walks though the steps along with a link to a sample application.