Oracle TNS别名连接有效,EZConnect不

发布于 2025-01-21 22:11:56 字数 1423 浏览 2 评论 0原文

使用sqlplus和一个TNS名称别名,我可以成功连接:

sqlplus xxxxxx/yyyyyy@zzzzz

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Apr 17 15:48:14 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Last Successful login time: Sun Apr 17 2022 15:33:24 -04:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

然后,我使用了tnsnames.ora条目:

tnsping zzzzz

TNS Ping Utility for 32-bit Windows: Version 19.0.0.0.0 - Production on 17-APR-2022 15:58:46

Copyright (c) 1997, 2019, Oracle.  All rights reserved.

Used parameter files:
C:\app\client\product\19.0.0\client_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = host.domain.tld)(PORT = 1515)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = service.domain.tld)))
OK (50 msec)

尝试使用ezconnect语法进行连接:

sqlplus xxxxx/[email protected]:1515/service.domain.tld

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Apr 17 16:01:13 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

如您所见,它失败了。我想我缺少一些东西,但是什么?

Using sqlplus and a tns names alias, I can connect successfully:

sqlplus xxxxxx/yyyyyy@zzzzz

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Apr 17 15:48:14 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Last Successful login time: Sun Apr 17 2022 15:33:24 -04:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

I then took the tnsnames.ora entry:

tnsping zzzzz

TNS Ping Utility for 32-bit Windows: Version 19.0.0.0.0 - Production on 17-APR-2022 15:58:46

Copyright (c) 1997, 2019, Oracle.  All rights reserved.

Used parameter files:
C:\app\client\product\19.0.0\client_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = host.domain.tld)(PORT = 1515)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = service.domain.tld)))
OK (50 msec)

and tried to connect using ezconnect syntax:

sqlplus xxxxx/[email protected]:1515/service.domain.tld

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Apr 17 16:01:13 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

Which failed as you can see. I guess I'm missing something, but what?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文