创建Oracle到SQL Server的数据库链接时出错
我正在创建将Oracle(11gR2)(Windows Server 2008)链接到SQL Server(Windows 10)的数据库链接 我已安装Oracle网关 我在ODBC数据源管理器中创建了一个数据字体,连接正常。他的名字叫英格拉 我修改了listener.ora、tnsnames.ora、sqlnet.ora和initIntegra.ora文件 按照我的设置: 服务器Oracle无IP:192.168.1.22 服务器SQLServer无Ip:192.168.1.18 Listener.ora创建Oracle到SQL Server的数据库链接时出错,oracle,odbc,listener,dblink,tnsnames,Oracle,Odbc,Listener,Dblink,Tnsnames,我正在创建将Oracle(11gR2)(Windows Server 2008)链接到SQL Server(Windows 10)的数据库链接 我已安装Oracle网关 我在ODBC数据源管理器中创建了一个数据字体,连接正常。他的名字叫英格拉 我修改了listener.ora、tnsnames.ora、sqlnet.ora和initIntegra.ora文件 按照我的设置: 服务器Oracle无IP:192.168.1.22 服务器SQLServer无Ip:192.168.1.18 Listen
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
Integra =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Integra)
)
)
# 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>
# 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)
tnsnames.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
Integra =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Integra)
)
)
# 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>
# 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)
initIntegra.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
Integra =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Integra)
)
)
# 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>
# 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)
创建数据库链接
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中,主机必须是LOCALHOST和端口1521
谢谢。我看到有太多问题无法在评论中列出。有些与你的问题有关,有些只是粗心或不理解的表现 您的网关是否安装在Oracle计算机、MSSQL计算机或其他计算机上?我问,因为它是很可能安装在任何地方。在我的商店里,我有多个指向多个MSSQL数据库的oracle链接,我的网关在一台“中立”机器上。就像我说的,这不要紧,因为我们需要保持通信路径的每一个环节都是直线的
我在上有一篇较长的文章,附有图片,请用英语发表。@desertnaut有什么问题吗?除了你的文章不是用英语,你的意思是(编辑之前)?我不确定,没有仔细看…@desertnaut我已经为英语更新了我看到了;我不明白你为什么问“怎么了”,因为你可能已经知道了。是的,对项目做出回应。1) 嗯。2) 在我的环境中,我是对的,我只是抄错了。3) 是的,出于隐私的考虑,我缩写了它。4) 好的,更正了。6) 好的,更正了。我基本上遵循了你的链接,效果非常好。谢谢