1.Oracle 所在伺服器上安裝Sybase client(或者在同一臺server上安裝Oracle 、Sybase伺服器),確保能夠Oracle 訪問Sybase資料庫;
2.安裝TRANSPARENT GATEWAY FOR Sybase選件,要用自定義安裝。正確選擇Sybase的安裝目錄;
3.選擇一個sid字串準備賦給Sybase資料庫。如:tg4sybs設定Sybase的dll路徑到環境變數PATH(這一步很重要);
4.修改初始化檔案,預設的是:Oracle_HOME\tg4sybs\admin\inittg4sybs.ora設定引數HS_FDS_CONNECT_INFO格式:HS_FDS_CONNECT_INFO=server_name.database_name[,INTERFACE=interface_file]server_name.database_name是大小寫敏感的。INTERFACE可選例子:如下# This is a sample agent init file that contains the HS parameters that are# needed for the Transparent Gateway for Sybase## HS init parameters#HS_FDS_CONNECT_INFO=migration_serv.taxHS_FDS_TRACE_LEVEL= OFFHS_FDS_RECOVERY_ACCOUNT=RECOVERHS_FDS_RECOVERY_PWD=RECOVER ## Environment variables required for Sybase#set SYBASE=d:\sybase上例中server_name是migration_servdatabase_name是tax5.配置Oracle 網路服務的listener,配置檔案是:listener.ora預設路徑:Oracle_HOME\network\admin加入如下:SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME= gateway_sid)(Oracle _HOME= Oracle _home_directory)(PROGRAM=tg4sybs))) gateway_sid就是3選擇的sid字串Oracle _home_directory是Oracle _HOMEtg4sybs若是SYBASE是特定的。如果是其他資料庫,會不同。例子如下:(SID_DESC=(SID_NAME=tg4sybs)(Oracle_HOME=D:\Oracle\ora92)(PROGRAM=tg4sybs))6.停止監聽lsnrctlstop重新啟動監聽程式lsnrctlstart7.配置Oracle server的tnsnames.ora使其能夠Oracle 訪問sybaseconnect_descriptor=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST= host_name)(PORT= port_number)) (CONNECT_DATA=(SID= gateway_sid))(HS=OK)) connect_descriptor是連線串,任取,一般為sybshost_name:Oracle server的nameport_number:Oracle 監聽埠gateway_sid就是3選擇的sid字串例子如下:sybs=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dw-server1)(PORT=1521)))(CONNECT_DATA=(SID=tg4sybs))(HS=OK))8.建立database link如:CREATEDATABASELINKsybsCONNECTTOsaIDENTIFIEDBYprientUSING"SBYS";即可訪問sybase 資料庫。需要注意的是,sybase資料庫的表名,欄位名原始碼天空,如果是小寫的,那麼在Oracle 裡訪問的時候要加上雙引號如:SQL〉selectafromb@sybs;
1.Oracle 所在伺服器上安裝Sybase client(或者在同一臺server上安裝Oracle 、Sybase伺服器),確保能夠Oracle 訪問Sybase資料庫;
2.安裝TRANSPARENT GATEWAY FOR Sybase選件,要用自定義安裝。正確選擇Sybase的安裝目錄;
3.選擇一個sid字串準備賦給Sybase資料庫。如:tg4sybs設定Sybase的dll路徑到環境變數PATH(這一步很重要);
4.修改初始化檔案,預設的是:Oracle_HOME\tg4sybs\admin\inittg4sybs.ora設定引數HS_FDS_CONNECT_INFO格式:HS_FDS_CONNECT_INFO=server_name.database_name[,INTERFACE=interface_file]server_name.database_name是大小寫敏感的。INTERFACE可選例子:如下# This is a sample agent init file that contains the HS parameters that are# needed for the Transparent Gateway for Sybase## HS init parameters#HS_FDS_CONNECT_INFO=migration_serv.taxHS_FDS_TRACE_LEVEL= OFFHS_FDS_RECOVERY_ACCOUNT=RECOVERHS_FDS_RECOVERY_PWD=RECOVER ## Environment variables required for Sybase#set SYBASE=d:\sybase上例中server_name是migration_servdatabase_name是tax5.配置Oracle 網路服務的listener,配置檔案是:listener.ora預設路徑:Oracle_HOME\network\admin加入如下:SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME= gateway_sid)(Oracle _HOME= Oracle _home_directory)(PROGRAM=tg4sybs))) gateway_sid就是3選擇的sid字串Oracle _home_directory是Oracle _HOMEtg4sybs若是SYBASE是特定的。如果是其他資料庫,會不同。例子如下:(SID_DESC=(SID_NAME=tg4sybs)(Oracle_HOME=D:\Oracle\ora92)(PROGRAM=tg4sybs))6.停止監聽lsnrctlstop重新啟動監聽程式lsnrctlstart7.配置Oracle server的tnsnames.ora使其能夠Oracle 訪問sybaseconnect_descriptor=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST= host_name)(PORT= port_number)) (CONNECT_DATA=(SID= gateway_sid))(HS=OK)) connect_descriptor是連線串,任取,一般為sybshost_name:Oracle server的nameport_number:Oracle 監聽埠gateway_sid就是3選擇的sid字串例子如下:sybs=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dw-server1)(PORT=1521)))(CONNECT_DATA=(SID=tg4sybs))(HS=OK))8.建立database link如:CREATEDATABASELINKsybsCONNECTTOsaIDENTIFIEDBYprientUSING"SBYS";即可訪問sybase 資料庫。需要注意的是,sybase資料庫的表名,欄位名原始碼天空,如果是小寫的,那麼在Oracle 裡訪問的時候要加上雙引號如:SQL〉selectafromb@sybs;