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

硬件及软件环境

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

二、数据库环境

系统1Oracle 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_HOME9i安装目录)下找到tg4msql目录。

四、修改配置文件。

1、 系统1$ORACLE_HOMEtg4msqladmin下,新建立两个.ora文件—initpda.orainitems.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、修改透明网关所在Serverlistener.ora文件(位于$ORACLE_HOMEnetworkadmin下),添加相应内容,此处的$ORACLE_HOME9i的安装目录。

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_HOME8i的安装目录。

添加内容:

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 Servere4pdmems已有足够权限,用户登陆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的状态正常,对结果没影响。

转到8ibin目录下:

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博客 ” ,链接:http://blog.itpub.net/34329/viewspace-911601/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/34329/viewspace-911601/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值