ITPub博客

首页 > 数据库 > Oracle > Oracle 9i 透明网关(Transparent Gateway)连接SQL Server配置指南(转载)

Oracle 9i 透明网关(Transparent Gateway)连接SQL Server配置指南(转载)

原创 Oracle 作者:m77m78 时间:2007-04-19 21:30:13 0 删除 编辑
、硬件及软件环境

1、 系统1: Windows2000 Server + Oracle8.17 + Oracle 9i透明网关

2、 系统2: Windows2000 Server + SQL Server 2000

3、 系统3: Windows2000 Server + SQL Server2000

[@more@]

一、硬件及软件环境

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_HOMEtg4msqladmin下,新建立两个.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_HOMEnetworkadmin下),添加相应内容,此处的$ORACLE_HOME是9i的安装目录。

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC=

(SID_NAME=pda)

(ORACLE_HOME=e:oracleora92)

(PROGRAM=tg4msql)

)

(SID_DESC=

(SID_NAME=ems)

(ORACLE_HOME=e:oracleora92)

(PROGRAM=tg4msql)

)

)

3,修改Oracle数据库的tnsnames.ora文件(位于$ORACLE_HOMEnetworkadmin下),添加两个服务。

此处的$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文件(:oracleadminSIDorapfile下),将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:oracleora92networkadminlistener.ora

Listener Log File e:oracleora92networkloglistener.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...

The command completed successfully

UNKNOWN的状态正常,对结果没影响。

转到8i的bin目录下:

D:oracleora81bin>tnsping pda

若看到

Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=10.89.54.152)(PORT=1521))

OK (0 msec)

的信息表示连接ok了。

再看ems的连接.

D:oracleora81bin>tnsping ems

Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=10.89.54.152)(PORT=1521))

OK (0 msec)

8, 测试

SQL>Select “dno” from dm@e4pdm where rownum<2

Dno

---------

C0-000

SQL>select “dep_co” from ems@ems where rownum<2

Dep_co

-------------

DC0001

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/34329/viewspace-911601/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-04-25

  • 博文量
    168
  • 访问量
    764672