一、硬件及软件环境
1、 系统1: Windows2000 Server + Oracle8.17 + Oracle 9i透明网关
2、 系统2: Windows2000 Server + SQL Server 2000
3、 系统3: Windows2000 Server + SQL Server2000
二、数据库环境
系统1含Oracle 8i数据库及Oracle9i 透明网关,IP: 10.89.54.152
系统2 目标数据库是pda, IP :10.89.54.162
系统3 目标数据库是ems , IP: 10.89.54.36
三、安装说明
透明网关 for MS SQL Server的版本必须安装在Windows平台下。Oracle9i安装光盘自带该组件,但Oracle8i需另购买。Oracle 9i安装时Transparent Gateway默认是不安装的,要想安装该组件,需在安装Oracle9i的时候选择自定义安装,然后在安装产品列表中选择Oracle Transparent Gateway->Transparent Gateway for MS SQL Server.. Oracle数据库和Oracle透明网关可以在不同的服务器上。
在安装完透明网关后,可以在$ORACLE_HOME(9i安装目录)下找到tg4msql目录。
四、修改配置文件。
1、 系统1的$ORACLE_HOME/tg4msql/admin/下,新建立两个.ora文件—initpda.ora和initems.ora.。
内容分别是:
initpda.ora :
HS_FDS_CONNECT_INFO="SERVER=10.89.54.162;DATABASE=pda"
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
initems.ora :
HS_FDS_CONNECT_INFO="SERVER=10.89.54.36;DATABASE=ems"
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
2、修改透明网关所在Server的listener.ora文件(位于$ORACLE_HOME/network/admin下),添加相应内容,此处的$ORACLE_HOME是9i的安装目录。
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC=
(SID_NAME=pda)
(ORACLE_HOME=e:/oracle/ora92)
(PROGRAM=tg4msql)
)
(SID_DESC=
(SID_NAME=ems)
(ORACLE_HOME=e:/oracle/ora92)
(PROGRAM=tg4msql)
)
)
3,修改Oracle数据库的tnsnames.ora文件(位于$ORACLE_HOME/network/admin下),添加两个服务。
此处的$ORACLE_HOME是8i的安装目录。
添加内容:
pda=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.89.54.152)(PORT = 1521))
) //这里的HOST必须填网关所在Server地址
(CONNECT_DATA =
(SID =pda) //此SID与透明网关所改的listener.ora中的SID_NAME对应
)
(HS =pda)
)
ems=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.89.54.152)(PORT = 1521))
) //这里的HOST必须填网关所在Server地址
(CONNECT_DATA =
(SID =ems) //此SID与透明网关所改的listener.ora中的SID_NAME对应
)
(HS =ems)
)
4,设置Oracle数据库参数global_names=false。
修改Oracle数据库的init文件(:/oracle/admin/SIDora/pfile下),将global_name 设为false.,不要求建立的数据库链接和目的数据库的全局名称一致.修改init文件需重起数据库。
5, 建立公有的数据库链接:
create public database link pda
connect to testuser identified by testuser_pwd using pda;
create public database link ems
connect to testuser identified by testuser_pwd using ems;
(假设SQL Server库e4pdm和ems已有足够权限,用户登陆testuser,密码为testuser_pwd)
6, 重起Oracle8i数据库,重启9i的监听服务。
7, 测试连接
在dos下输入lsnrctl.
Lsnrctl>status
------------------------------------------------------------------------------------------------------------------------------
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.89.54.152)(PORT=1521)
))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Produc
tion
Start Date 23-SEP-2004 13:13:13
Uptime 0 days 1 hr. 29 min. 10 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File e:/oracle/ora92/network/admin/listener.ora
Listener Log File e:/oracle/ora92/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.89.54.152)(PORT=1521)))
Services Summary...
Service "pda" has 1 instance(s).
Instance "pda", status UNKNOWN, has 1 handler(s) for this service...
Service "ems" has 1 instance(s).
Instance "ems", status UNKNOWN, has 1 handler(s) for this service...