暂无图片
分享
包忠鑫
2020-03-12
自己通过TNS登陆报错,ORA-12154: TNS:could not resolve the connect identifier specified

TNSping可以ping通
[oracle@racdg ~]$ tnsping racdg

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 11-MAR-2020 00:58:35

Copyright © 1997, 2013, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdg) (UR = A)))
OK (10 msec)

TNS登陆却报错
sqlplus sys/123456@orcldg as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 11 00:54:19 2020

Copyright © 1982, 2013, Oracle. All rights reserved.

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

TNS的配置:
racdg =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdg)
(UR = A)
)

)

请问大佬们,这是什么情况?

收藏
分享
2条回答
默认
最新
高达

确保监听正常,配置正确的 TNS,格式如下:

ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)

暂无图片 评论
暂无图片 有用 1
包忠鑫
问题已关闭: 问题已经得到解决
暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏