標籤:oracle 透明網關 gateway
Oracle Gateway使用分享1、背景說明
公司一直會碰到異構資料庫的串連問題,比如Oracle需要dblink as400,dblink DB2,如果此些資料庫版本比較老的話,在linux 64位環境中配置此類資料庫的驅動,太讓人頭疼了。
可以使用Oracle gateway方式,將gateway部署在一台windows 32位的伺服器(可以有效解決資料庫驅動問題),odbc至異構資料庫。
將gateway從db伺服器中分離出來單獨安裝
單獨開啟監聽,給需連結異構伺服器至資料庫提供串連服務
新增gateway伺服器安裝windows 32位系統,有效解決資料庫驅動相容性問題
2、架構說明650) this.width=650;" title="gateway.png" alt="wKiom1jlq_mxv6nqAABUAyXukEg102.png-wh_50" src="https://s4.51cto.com/wyfs02/M00/8F/92/wKiom1jlq_mxv6nqAABUAyXukEg102.png-wh_500x0-wm_3-wmp_4-s_4139837427.png" />3、GW安裝及配置說明
1、安裝伺服器gateway,僅安裝透明網關OS SERVER 2003 sp2,32位 記憶體2g 硬碟空間50GB透明網關版本11gr2 32位2、配置監聽3、安裝db2和as400用戶端程式(提供資料庫驅動檔案)4、配置odbc,並測試連接正常5、添加並修改透明網關設定檔(檔案位置在home目錄下C:\product\11.2.0\tg_1\hs\admin )添加檔案命名為init_sid.ora注意點:sid和odbc中名稱要一致# This is a sample agent init file that contains the HS parameters that are# needed for an ODBC Agent.## HS init parameters#HS_FDS_CONNECT_INFO = hispHS_FDS_TRACE_LEVEL = off## Environment variables required for the non-Oracle system##set <envvar>=<value>6、修改tnsnamesC:\product\11.2.0\tg_1\NETWORK\ADMINHISP = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = gateway伺服器ip)(PORT = 1521)) ) (CONNECT_DATA = (SID = hisp) ) (HS = OK)---------使用gateway方式串連 )7、修改listener,並重啟監聽SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = hisp) (ORACLE_HOME = C:\product\11.2.0\tg_1) (SID_NAME = hisp) (PROGRAM = dg4odbc)-----注意點:9i透明網關此處使用的程式為hs ) )此時gateway伺服器已配置完成
4、Oracle DB配置
只需在需求DB的tns中添加如下條目即可HISP = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521)) )---------------------------*.*.*.*為gateway伺服器 (CONNECT_DATA = (SID = hisp) ) (HS = OK)--------------使用gateway方式串連 )
5、測試結果說明
測試結果:建立dblinkcreate database link wcelpptp connect to "******" identified by "******" using ‘hisp‘測試dblink,測試OK 經測試:需求DB無os版本限制,windows和Linux均可正常串連
本文出自 “Open World” 部落格,請務必保留此出處http://voidyao000.blog.51cto.com/12458042/1913299
Oracle Gateway使用分享