安装oracle 的transparent gateway 透明网关
安装ORACLE 选择自定义安装 然后再选择 安装透明网关再进去选择 安装FOR SQLSERVER 的组件
修改 oraclehomeoratgsmsqladmininittgmsqlorq 文件
HS_FDS_CONNECT_INFO="SERVER=YIRONGNO;DATABASE=jsoct"
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
说明 可以通过 ORACLE 工具中的migration WorkBench 进行配置(过程中需要配置ODBC)
建立监听 修改oracle 的 oraclehomeoranetworkadminlistenerora 文件
# LISTENERORA Network Configuration File: F:oracleoranetworkadminlistenerora
# Generated by Oracle configuration tools
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = yirongno)(PORT = ))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = F:oracleora)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = orai)
(ORACLE_HOME = F:oracleora)
(SID_NAME = orai)
)
#连接 sqlserver
(SID_DESC =
(GLOBAL_DBNAME = tgmsql)
(PROGRAM = tgmsql)
(SID_NAME = tgmsql)
(ORACLE_HOME = F:oracleora)
)
)
修改TNS
TGMSQL =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=))
(CONNECT_DATA=(SID=tgmsql))
(HS=)
)
创建DBLINK 说明建立的 用户名密码要是 SQLSERVER 的用户名和密码
create PUBLIC DATABASE LINK oratoSql
CONNECT TO sa IDENTIFIED BY "lanwei"
USING TGMSQL ;
测试数据的是否正常检索