DB从Oracle链接到SQL Server

时间:2016-04-20 06:36:10

标签: sql-server oracle oracle11g database-administration dblink

我正在尝试将Oracle 11G用户连接到SQL Server 2012数据库。我使用ODBC系统DSN创建了一个数据源。我在$ ORACLE_HOME \ hs \ admin文件夹下配置了oracle异构服务,但是当我尝试ping新的监听器时会抛出异常。我的配置如下:

我的initdg4odbc配置:

# 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 = OTOSS
HS_FDS_TRACE_LEVEL = OFF


#
# Environment variables required for the non-Oracle system
#
#set <envvar>=<value>

监听器配置

# This is a sample listener.ora that contains the NET8 parameters that are
# needed to connect to an HS Agent

OTOSS =
 (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1522))
      (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))

SID_LIST_OTOSS=
  (SID_LIST=
      (SID_DESC=
         (SID_NAME=OTOSS)
         (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_2)
         (PROGRAM=dg4odbc)
       )
      )

#CONNECT_TIMEOUT_LISTENER = 0 

tnsnames配置

# This is a sample tnsnames.ora that contains the NET8 parameters that are
# needed to connect to an HS Agent

OTOSS =
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1522))
    (CONNECT_DATA=(SID=OTOSS))
    (HS=OK)
  )

我在哪里做错了什么?

1 个答案:

答案 0 :(得分:0)

这是一个古老的问题,但仍然可能会有所帮助。 尝试将initdg4odbc.ora名称更改为initOTOSS.ora,确保系统DSN名为OTOSS,并且系统DSN对应所需的体系结构(32位或64位)。然后,如果使用Windows系统,重新启动它应该工作。 有关详细信息,请使用此问题的配置: Connect MS SQL to Oracle Database