oracle和sqlserver互訪(2)
2.透過"透明閘道器"方式聯接
程式碼:
// A. 安裝透明閘道器,在安裝時選擇自定義安裝,安裝TRANSPARENT GATEWAY FOR SQLSERVER 元件,安裝成功後會產生oracle_homeora90tg4msql目錄!
// B. 配置TNSNAMES.ORA,路徑:ORACLE_HOMENETWORKADMIN,這一步應該在ORACLEDB(192.168.1.52)上配置!TG4MSQL = # tnsName
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.221)(PORT = 1521)) # 閘道器IP
)
(CONNECT_DATA =
(SID = tg4msql ) #SID,要和監聽器裡的SID一致!
)
(HS=OK)
)// C. 配置listener.ora,路徑:ORACLE_HOMENETWORKADMINLISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.221)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = tg4msql)
(SID_NAME = tg4msql)
(ORACLE_HOME = D:oracleora9i)
(PROGRAM= tg4msql)
)
)// D. 重啟監聽器服務
// E. 編輯ORACLE_HOMETG4MSQLADMIN內init.ora,這裡是inittg4msql.ora,因為上面的SID=tg4msql
#HS_FDS_CONNECT_INFO="SERVER=ERPSQL;DATABASE=EK",好多人說用這行可以,我用這行的時候出現了不能開啟連結的錯誤,改下面一行就沒問題了!HS_FDS_CONNECT_INFO=ERPSQL.EK
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER// F. 建立DB LINK,以及測試SQL> create database link msql2 connect to "sa" identified by "pass" using 'TG4MSQL';
Database link created
SQL> select ta001,ta002 from acpta@msql2 where rownum<5;
TA001 TA002----- -----------S710 20020306001
S710 20020315001
S710 20020325001
S710 20020326001--------
[@more@]程式碼:
SQL> set timing on
SQL> select ta001,ta002 from acpta@ora2sql where rownum<10;
TA001 TA002----- -----------S710 20020306001
S710 20020315001
S710 20020325001
S710 20020326001
S710 20020328001
S710 20020329001
S710 20020419001
S710 20020422001
S710 20020425001
9 rows selected
Executed in 0.047 seconds
SQL> select ta001,ta002 from acpta@msql2 where rownum<10;
TA001 TA002----- -----------S710 20020306001
S710 20020315001
S710 20020325001
S710 20020326001
S710 20020328001
S710 20020329001
S710 20020419001
S710 20020422001
S710 20020425001
9 rows selected
Executed in 52.281 seconds--------
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18921899/viewspace-1017081/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle和sqlserver互訪(轉)OracleSQLServer
- oracle和sqlserver互訪(1)OracleSQLServer
- oracle和sqlserver互訪(3)OracleSQLServer
- Oracle透明閘道器訪問SQLServer資料庫OracleSQLServer資料庫
- 如果需要從Oracle遷移到MS SQLServer (2)OracleSQLServer
- Struts2和Oracle資料庫互動的小DemoOracle資料庫
- SQLServer和Oracle常用函式對比SQLServerOracle函式
- Oracle,SqlServer,Access資料庫通用訪問類設計(轉)OracleSQLServer資料庫
- 外網訪問本地sqlserverSQLServer
- Oracle和sqlserver資料型別對應OracleSQLServer資料型別
- SQLServer和Oracle的常用函式對比SQLServerOracle函式
- sqlserver 行列互轉實現小結SQLServer
- Oracle VirtualBox 配置宿主機與虛擬機器互訪Oracle虛擬機
- sqlserver筆記2SQLServer筆記
- sqlserver連線oracleSQLServerOracle
- SQLSERVER 連線 ORACLESQLServerOracle
- oracle DBLink sqlserverOracleSQLServer
- ORACLE臨時表和SQLSERVER臨時表異同OracleSQLServer
- SQLServer解析xml到OracleSQLServerXMLOracle
- GoldenGate實現oracle和sqlserver雙向資料同步GoOracleSQLServer
- 輸入流和字串互轉InputStream2String和String2InputStream字串
- Oracle 12. 2 RAC public IP與vip 互換方法Oracle
- SQLServer開啟CDC功能(2)SQLServer
- 大資料視覺化安全保障之私密訪問:讓訪問和互動更安全大資料視覺化
- 檔案和目錄的訪問控制(2)新增訪問控制
- 10g透明閘道器訪問sqlserverSQLServer
- 透明閘道器 oracle 10g for sqlserver 和sybase的配置Oracle 10gSQLServer
- (原)將Oracle遷移到SQLServerOracleSQLServer
- WEKA連線MySQL,Oracle,SQLServerMySqlOracleServer
- SQLServer訪問Oracle(通過同義詞-檢視-資料字典)出現的問題SQLServerOracle
- shell oracle互動Oracle
- Holer實現外網訪問SQLServer資料庫SQLServer資料庫
- SQLServer控制使用者訪問許可權表SQLServer訪問許可權
- Windows XP 解決互訪問題(轉)Windows
- Angular2的Promise和Observable訪問介面模式AngularPromise模式
- oracle 互鎖的sqlOracleSQL
- Sqlserver表和索引壓縮SQLServer索引
- oracle連線SQLserver--通過ODBCOracleSQLServer