ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 配置Oracle到MS SQL Server的透明网关

配置Oracle到MS SQL Server的透明网关

原创 Linux操作系统 作者:NinGoo 时间:2019-03-26 21:03:06 0 删除 编辑

环境:
Oracle:
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production

MS SQL Server:Microsoft SQL Server 2000 - 8.00.194 (Intel X86)
Aug 6 2000 00:57:48
Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on Windows NT 5.0 (Build 2195: Service Pack 4)



一.安装透明网关
执行Oracle universal installer,安装类型选择custom。安装组件选oracle transparent gatewaysoracle transparent gateway for microsoft sql server

二.配置监听
在$ORACLE_HOMEnetworkadminlistener.ora的SID_LIST_LISTENER部分添加
(SID_DESC =
(GLOBAL_DBNAME = tg4msql)
(PROGRAM = tg4msql)
(SID_NAME = sql2000)
(ORACLE_HOME = D:oracleora92)
)

三.配置透明网关参数文件
安装完透明网关组件后,在$ORACLE_HOMEtg4msqladmin文件夹中,会生成一个叫inittg4msql.ora的配置文件,将其改名为initsql2000.ora,其中sql2000即上一步中设置的SID_NAME=sql2000,该文件的主要内容:
HS_FDS_CONNECT_INFO="SERVER=test;DATABASE=pubs"
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER

四.配置本地服务名
在$ORACLE_HOMEnetworkadmintnsnames.ora中加上:
sql2000 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = test)(PORT = 1521))
)
(CONNECT_DATA =
(SID = sql2000)
)
(HS = OK)
)

五.创建database link
create public database link db_sql connect to ning identified by ning using 'sql2000';

六.通过dataase link读取sql server中的数据
SQL> select * from
jobs@db_sql;

job_id job_desc min_lvl max_lvl
---------- ------------------------------ ---------- ----------
1 New Hire - Job not specified 10 10
2 Chief Executive Officer 200 250
3 Business Operations Manager 175 225
4 Chief Financial Officier 175 250
5 Publisher 150 250
6 Managing Editor 140 225
7 Marketing Manager 120 200
8 Public Relations Manager 100 175
9 Acquisitions Manager 75 175
10 Productions Manager 75 165
11 Operations Manager 75 150

job_id job_desc min_lvl max_lvl
---------- ------------------------------ ---------- ----------
12 Editor 25 100
13 Sales Representative 25 100
14 Designer 25 100

14 rows selected.

其他如到sybase的透明网关的配置步骤也是一样的,装组件,配监听,配参数文件,配本地服务名,建数据库连接,ok

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

上一篇: 买了个魅族E3
请登录后发表评论 登录
全部评论

注册时间:2004-12-07

  • 博文量
    200
  • 访问量
    132052