. 检查oracle 透明网关插件是否已经. 安装后会存在 $ORACLE_HOME\tg4msql 这个文件夹.若没有安装择需要oracle 介质去安装.
在安装企业版选择自定义时 ,选择transparent gateway for sqlserver 即可.(默认是没有安装这个组件)
2. 在安装过程中会提示选择 数据库地址,和数据库名称.
3. 安装完成后,就可以配置init文件, 默认会生成inittg4msql.ora文件.
在目录 $ORACLE_HOME\tg4msql\admin下面 建立文件名 init
.ora
initphone.ora配置内容:
# This is a sample agent init file that contains the HS parameters that are
# needed for the Transparent Gateway for
#
# HS init parameters
#
HS_FDS_CONNECT_INFO="SERVER=192.168.60.91;DATABASE=phone"
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER4. 配置listener.ora
在SID_LIST_LISTENER 中添加SID_DESC , 描述sql server db 的信息
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = d:\oracle\ora92)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_NAME = PayCent)
(ORACLE_HOME = d:\oracle\ora92)
(SID_NAME = oradb)
)
(SID_DESC =
(SID_NAME = phone)
(ORACLE_HOME = d:\oracle\ora92)
(PROGRAM = tg4msql)
)
)
5. 配置tnsnames.ora
SQLSERVER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.60.91)(PORT = 1521))
)
(CONNECT_DATA =
(SID = phone)
)
(HS=OK)
)
6. 建立dblink
create database link SQLSERVER
connect to SA identified by SA
using 'SQLSERVER';
7. .
select * from;
阅读(997) | 评论(0) | 转发(0) |