Oracle登录报错ORA-12504: TNS: 监听程序在 CONNECT_DATA 中未获得 SERVICE_NAME

0    244    1

Tags:

👉 本文共约1704个字,系统预计阅读时间或需7分钟。

现象

版本:11.2.0.1

ORA-12504: TNS: 监听程序在 CONNECT_DATA 中未获得 SERVICE_NAME

ORA-12543: TNS: 无法连接目标主机

ORA-12543: TNS:destination host unreachable

EZConnect or Hostname Adapter Usage: ORA-12504 (Doc ID 2550189.1)

APPLIES TO:

Oracle Net Services - Version 11.2.0.3 to 18.1.0.0.0 [Release 11.2 to 18.1]
Information in this document applies to any platform.

SYMPTOMS

While attempting to use the EZCONNECT Naming adapter, the following error is returned:

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

Example:

sqlplus system@hostname.domain:port/service_name

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

An Oracle Net trace reveals that the SERVICE_NAME field is not populated when the connection attempt is being made:

(4111095552) [17-APR-2019 22:13:40:047] nspsend: 00 00 28 44 45 53 43 52 |..(DESCR|
(4111095552) [17-APR-2019 22:13:40:047] nspsend: 49 50 54 49 4F 4E 3D 28 |IPTION=(|
(4111095552) [17-APR-2019 22:13:40:047] nspsend: 43 4F 4E 4E 45 43 54 5F |CONNECT_|
(4111095552) [17-APR-2019 22:13:40:047] nspsend: 44 41 54 41 3D 28 53 45 |DATA=(SE|
(4111095552) [17-APR-2019 22:13:40:047] nspsend: 52 56 49 43 45 5F 4E 41 |RVICE_NA|
(4111095552) [17-APR-2019 22:13:40:047] nspsend: 4D 45 3D 29 28 43 49 44 |ME=)(CID|<===nothing in SERVICE_NAME field
(4111095552) [17-APR-2019 22:13:40:047] nspsend: 3D 28 50 52 4F 47 52 41 |=(PROGRA|

(4111095552) [17-APR-2019 22:13:40:047] nspsend: 29 29 |)) |

(4111095552) [17-APR-2019 22:13:40:048] niqme: entry
(4111095552) [17-APR-2019 22:13:40:048] niqme: reporting NS-12564 error as ORA-12564
(4111095552) [17-APR-2019 22:13:40:055] niqme: exit
(4111095552) [17-APR-2019 22:13:40:055] niomapnserror: exit
(4111095552) [17-APR-2019 22:13:40:055] niqme: entry
(4111095552) [17-APR-2019 22:13:40:055] niqme: reporting NSG-12504 error as ORA-12504
(4111095552) [17-APR-2019 22:13:40:055] niqme: exit
(4111095552) [17-APR-2019 22:13:40:055] niotns: Couldn't connect, returning 12504

CAUSE

It is necessary to EITHER include the password on the same line OR to escape the EZCONNECT string and supply the password on the subsequent line.

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信dbaup66,谢谢!
AiDBA后续精彩内容已被站长无情隐藏,请输入验证码解锁本文!
验证码:
获取验证码: 请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“AiDBA”或者“dbaup6”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复