Oracle TNS别名连接有效,EZConnect不
使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论