对于在 TOAD 中工作的连接,Delphi 中出现错误 ORA-12154

发布于 2024-10-11 12:48:22 字数 220 浏览 7 评论 0原文

在 Delphi 2010 中,我想使用 ODAC 组件 (TOraSession) 连接到安装在我自己的计算机中的 Oracle XE 实例。当我设置连接参数时,收到“ORA-12154:TNS:无法解析指定的连接标识符”错误消息。

但是,使用相同的参数(和相同的 TNSNames.Ora 文件),我可以使用 TOAD 进行连接。

任何人都可以帮我解决这个问题吗?

提前致谢

In Delphi 2010 I want to connect to a Oracle XE instance installed in my own machine using the ODAC components (TOraSession). When I set the parameters for the connection I got the "ORA-12154: TNS: could not resolve the connect identifier specified" error message.

However using the same parameters (and the same TNSNames.Ora file) I can connect using TOAD.

Can anybody help me with this.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

断爱 2024-10-18 12:48:22

如果您在 x64 操作系统上运行,并且在带括号的路径中安装了 Delphi(或任何尝试访问 Oracle 的软件)(即 (x86)...),而 TOAD 没有安装,则可能会遇到此错误。

请参阅 Oracle 支持中的 DocID 334528.1(如果您有访问权限)。这个bug已经在后来的补丁中修复了,但是XE还没有官方补丁(基本上是10.2.0.1)。

我不会使用 Oracle XE,因为它实际上是一个不受支持的版本,没有为其发布补丁。如果您需要 Oracle 进行自学,您可以在 下载完整软件http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html(检查许可证),如果您需要免费的数据库服务器,请查看其他地方。

If you're running on a x64 OS and you have Delphi (or any software trying to access Oracle) installed in a path with parentheses (i.e (x86)...) while TOAD is not, you may encounter this error.

See DocID 334528.1 in Oracle Support (if you have access). This bug has been fixed in a later patch, but no official patch is available for XE (which basically is a 10.2.0.1).

I would not use Oracle XE because it is pratically an unsupported version, no patch are released for it. I you need Oracle for self-learning you can download the full software at http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html (check the license), if you need a free database server look elsewhere.

终陌 2024-10-18 12:48:22

可能是您没有使用相同的 tnsnames.ora (即使您认为您使用了)。例如,如果您安装了 Oracle 10g 客户端和 ODAC 11,则可能会发生这种情况。

要查看这是否是 tnsnames 问题,您可以尝试在不使用 tnsnames 的情况下通过如下代码进行连接:

(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) )(HOST=[MyHost])(PORT=[MyPort])))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=[MyOracleSID])));用户 ID=[myUsername];密码=[myPassword];

将 [] 之间的值替换为您的实际值,因此 (HOST=128.1.7.9)(PORT=1521)...

Could be that you are not using the same tnsnames.ora (even though you think you do). This can happen if you have for instance the Oracle 10g client installed and ODAC 11.

To see if this is a tnsnames issue you can try to connect without tnsnames from code like this:

(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=[MyHost])(PORT=[MyPort])))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=[MyOracleSID])));User Id=[myUsername];Password=[myPassword];

replacing the values between [] with your actual values so (HOST=128.1.7.9)(PORT=1521)....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文