gpt4 book ai didi

sql-server - 来自 oracle 的数据库链接 -> ms sql ORA-28545 & ORA-02063

转载 作者:行者123 更新时间:2023-12-03 17:12:22 29 4
gpt4 key购买 nike

我们在 Windows Server 2016 上安装了 Oracle 12c,在 Windows Server 2019 上安装了 MS SQL Server 2017。

当我们尝试通过 使用来自 Oracle -> MS SQL 的数据库链接时SELECT count(*) FROM SMSOUT@TOSIMSQLSERVER 我们得到以下错误:

ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from TOSIMSQLSERVER
28545. 0000 - "error diagnosed by Net8 when connecting to an agent"
*Cause: An attempt to call an external procedure or to issue SQL
to a non-Oracle system on a Heterogeneous Services database link
failed at connection initialization. The error diagnosed
by Net8 NCR software is reported separately.
*Action: Refer to the Net8 NCRO error message. If this isn't clear,
check connection administrative setup in tnsnames.ora
and listener.ora for the service associated with the
Heterogeneous Services database link being used, or with
'extproc_connection_data' for an external procedure call.
Error at Line: 1 Column: 29

数据库链接是由 创建的CREATE DATABASE LINK TOSIMSQLSERVER CONNECT TO "oms"IDENTIFIED BY "...our_pwd..."USING 'simsqlserver';

\hs\admin\initsimsqlserver.ora:
# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = simsqlserver
HS_FDS_TRACE_LEVEL = OFF

\network\admin\listener.ora:
# listener.ora Network Configuration File: C:\app\oracle\product\12.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\oracle\product\12.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\oracle\product\12.2.0\dbhome_1\bin\oraclr12.dll")
)
(SID_DESC =
(SID_NAME = simsqlserver)
(ORACLE_HOME = C:\app\oracle\product\12.2.0\dbhome_1)
(PROGRAM = dg4odbc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle12.pds.opds.cz)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

\network\admin\tnsnames.ora:
# tnsnames.ora Network Configuration File: C:\app\oracle\product\12.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

ORACLE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle12.pds.opds.cz)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oracle.pds.opds.cz)
)
)

LISTENER_ORACLE =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle12.pds.opds.cz)(PORT = 1521))

simsqlserver =
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)(HOST=oracle12.pds.opds.cz)(PORT=1521))
(CONNECT_DATA=(SID=simsqlserver))
(HS=OK)
)

\network\admin\sqlnet.ora:
# sqlnet.ora Network Configuration File: C:\app\oracle\product\12.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

有人可以帮我找出问题出在哪里吗? SQL ODBC 数据源测试正常。也可以 TNSPING 到 simsqlserver。

编辑 11.03.2020:
我们的 Oracle 是:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
PL/SQL Release 12.2.0.1.0 - Production
"CORE 12.2.0.1.0 Production"
TNS for 64-bit Windows: Version 12.2.0.1.0 - Production
NLSRTL Version 12.2.0.1.0 - Production

设置 HS_FDS_TRACE_LEVEL = 16 和 lsnrctl stop + lsnrctl start 后,我​​们有以下日志:

\oracle\diag\rdbms\oracle\oracle\trace\alert_oracle.log:
2020-03-11T13:27:40.813789+01:00
HS: Unable to establish RPC connection to HS Agent...
HS: ... Agent SID = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle12.pds.opds.cz)(PORT=1521))(CONNECT_DATA=(SID=simsqlserver))), NCR error = 65535 Unable to retrieve text of NETWORK/NCR message 65535

HS: Unable to establish RPC connection to HS Agent...
HS: ... Agent SID = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle12.pds.opds.cz)(PORT=1521))(CONNECT_DATA=(SID=simsqlserver))), NCR error = 65535 Unable to retrieve text of NETWORK/NCR message 65535

\oracle\diag\rdbms\oracle\oracle\alert\log.xml:
<msg time='2020-03-11T13:27:40.938+01:00' org_id='oracle' comp_id='rdbms'
type='UNKNOWN' level='16' host_id='ORACLE12'
host_addr='::1' module='SQL Developer' pid='2952'>
<txt>HS: Unable to establish RPC connection to HS Agent...
</txt>
</msg>
<msg time='2020-03-11T13:27:40.938+01:00' org_id='oracle' comp_id='rdbms'
type='UNKNOWN' level='16' host_id='ORACLE12'
host_addr='::1' module='SQL Developer' pid='2952'>
<txt>HS: ... Agent SID = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle12.pds.opds.cz)(PORT=1521))(CONNECT_DATA=(SID=simsqlserver))), NCR error = 65535 Unable to retrieve text of NETWORK/NCR message 65535
</txt>
</msg>

最佳答案

尝试删除

SQLNET.AUTHENTICATION_SERVICES= (NTS) 

来自 sqlnet.ora 的行。根据 MOS Doc ID 1266571.1,这不是 DG4ODBC 指定配置的一部分.

关于sql-server - 来自 oracle 的数据库链接 -> ms sql ORA-28545 & ORA-02063,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60620726/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com