【发布时间】:2020-09-25 12:37:11
【问题描述】:
我正在创建 DBLINK Oracle(11gR2)(Windows Server 2008) 到 SQL Server(Windows 10)。
我已经安装了 Oracle 网关。
我在 ODBC 数据源管理器中创建了一种数据字体,并且连接正常。他的名字是 Integra。
我修改了文件 listener.ora、tnsnames.ora、sqlnet.ora 和 initIntegra.ora。
按照我的设置:
服务器 Oracle 无 IP:192.168.1.22
Server SQLServer no Ip: 192.168.1.18
Listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = )
(ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
(PROGRAM = dg4odbc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Serverlab3)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app
tnsnames.ora
Integra =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Integra)
)
)
initIntegra.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= Integra
#
# Environment variables required for the non-Oracle system
#
#set <envvar>=<value>
sqlnet.ora
# 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)
创建 DBLINK
CREATE DATABASE LINK INTEGRA CONNECT TO "sa" IDENTIFIED BY "senha" USING 'Integra';
select * from tabela@INTEGRA;
SQL 错误 [28546] [99999]:ORA-28546:连接初始化失败,可能是 Net8 管理员错误。 ORA-02063: INTEGRA 的前一行*
注意:我在 ODBC 管理器中的数据源名称是 Integra。并且ODBC windows 管理员的连接测试工作完美。
一个问题: 在 TNSNAMES 中,HOST 必须是 LOCALHOST 和 PORT 1521?
谢谢。
【问题讨论】:
-
请用英文发帖。
-
@desertnaut 怎么了?
-
除了您的帖子不是英文,您的意思是(在编辑之前)?我不确定,没有仔细看...
-
@desertnaut 我已经更新了英文版
-
我看到了;我不明白你为什么问“出了什么问题”,因为你可能已经知道了。
标签: oracle odbc listener dblink tnsnames