oracle 11g的sqlserver透明網(wǎng)關(guān)已經(jīng)可以裝在任何機(jī)器上了,,不用再裝在sqlserver端了
一、環(huán)境:
gateway與oracle數(shù)據(jù)庫(kù)裝在同一臺(tái)機(jī)器上,ip:10.10.10.1
sqlserver在另一臺(tái)機(jī)器上,ip:10.10.10.10
oracle版本10.2
gateway版本11.2
oracle安裝目錄:/u01/app/oracle/product/10.2.1/db_1
gateway安裝目錄:/home/gateway/gwhome
二,、創(chuàng)建用戶gateway,用戶組與oracle用戶組相同就形
uid=501(gateway) gid=206(oinstall) groups=206(oinstall),207(dba)
修改環(huán)境變量
export ORACLE_HOME=/home/gateway/gwhome
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$ORACLE_HOME/bin:$PATH
三、創(chuàng)建/home/gateway/gwhome目錄
四、安裝gateway軟件,,選擇相應(yīng)的sqlserver組件,最后配置監(jiān)聽(tīng)的時(shí)候選擇執(zhí)行典型配置就可以了
五,、配置網(wǎng)關(guān)
1.修改監(jiān)聽(tīng)/home/gateway/gwhome/network/admin/listener.ora
注意(SID_NAME=test)的test必須對(duì)應(yīng)參數(shù)文件的名稱,,也就是參數(shù)文件名稱應(yīng)該為inittest.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC=
(SID_NAME=test)
(ORACLE_HOME=/home/gateway/gwhome)
(PROGRAM=dg4msql)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.1)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /home/gateway/gwhome
2.修改參數(shù)文件/home/gateway/gwhome/dg4msql/admin/inittest.ora
HS_FDS_CONNECT_INFO=[10.10.10.10]:1433//test
# alternate connect format is hostname/serverinstance/databasename
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
3.修改數(shù)據(jù)庫(kù)tns文件/u01/app/oracle/product/10.2.1/db_1/network/admin/tnsnames.ora,加入以下內(nèi)容
dg4msql =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.1)(PORT=1521))
(CONNECT_DATA=(SID=test))
(HS=OK)
)
4.創(chuàng)建DBLINK測(cè)試
create database link test connect to sa identified by test using 'dg4msql';
六,、監(jiān)聽(tīng)共享問(wèn)題
數(shù)據(jù)庫(kù)可以和網(wǎng)關(guān)用同一個(gè)監(jiān)聽(tīng),,如果想用不同監(jiān)聽(tīng)那把網(wǎng)關(guān)監(jiān)聽(tīng)端口和tns里的端口改一下就行了