远程ORACLE服务器连接字符串
我有一台 winxp 远程 Oracle 服务器和一台带有 IIS 的 Windows 7 计算机。
我将在 win7 计算机上托管一个站点,从我的 winxp 计算机上的 Oracle DB 获取信息。
但是,当我加载网页时,我收到 ORA-12154: TNS: 无法解析
我的 Tnsname.Ora 上指定的连接标识符,我得到以下信息:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 157.xxx.xx.xxx)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = ORCL.company.net)
)
)
奇怪的是,当我尝试从 WIN7 中通过 sqlplus 连接时,我可以通过提供以下凭据来做到这一点:
$ sqlplus MyUser/MyPass@ORCL
我得到的 ConnectionString 如下:
有谁知道可能出了什么问题吗?
连接字符串在我的本地开发计算机上运行,并带有一个看起来几乎相同的 tnsnames.ora 文件。
任何帮助将不胜感激!
Ive got a winxp remote Oracle Server and a Windows 7 machine with IIS.
I will be hosting a site on the win7 machine, getting information from an Oracle DB on my winxp machine.
However, when i load my webpage, i get ORA-12154:
TNS:could not resolve the connect identifier specified
on my Tnsname.Ora i`ve got the following:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 157.xxx.xx.xxx)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = ORCL.company.net)
)
)
The weird thing is that when i try to connect through sqlplus from the WIN7, I am able to do so by providing the following credentials:
$ sqlplus MyUser/MyPass@ORCL
The ConnectionString I've got is as follows:
Does anyone have any idea as to what might be wrong?
The connection string works on my local developement machine with a tnsnames.ora file that looks virtually the same.
Any help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过使用直接连接字符串,例如
Have you tried using a direct connection string eg
如果您将系统环境变量 TNS_ADMIN 设置为指向 tnsnames.ora 文件所在的目录,这对您的 Web 服务有帮助吗?在我看来,您的网络服务器正在查看错误的目录,因为它表示无法解析该名称。
If you set the system environment variable TNS_ADMIN to point at the directory where your tnsnames.ora file resides, does it help your web service? It sounds to me like your web server is looking at the wrong directory, since it's saying it can't resolve the name.
试试这个方法怎么样?
how about try this method ?