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資料庫OracleSQLServer資料庫
- Struts2和Oracle資料庫互動的小DemoOracle資料庫
- Oracle和sqlserver資料型別對應OracleSQLServer資料型別
- Oracle VirtualBox 配置宿主機與虛擬機器互訪Oracle虛擬機
- 外網訪問本地sqlserverSQLServer
- sqlserver筆記2SQLServer筆記
- Oracle 12. 2 RAC public IP與vip 互換方法Oracle
- 輸入流和字串互轉InputStream2String和String2InputStream字串
- SQLServer開啟CDC功能(2)SQLServer
- sqlserver讀取oracle資料庫資料SQLServerOracle資料庫
- 10g透明閘道器訪問sqlserverSQLServer
- Oracle 中varchar2 和nvarchar2區別Oracle
- Oracle外網訪問Oracle
- Oracle 訪問路徑Oracle
- 大資料視覺化安全保障之私密訪問:讓訪問和互動更安全大資料視覺化
- sqlserver建立與Oracle的連結伺服器SQLServerOracle伺服器
- 資料庫選型比對 Oracle vs sqlserver資料庫OracleSQLServer
- Holer實現外網訪問SQLServer資料庫SQLServer資料庫
- Oracle 級聯表更新和SQLServer 級聯表更新OracleSQLServer
- Sqlserver表和索引壓縮SQLServer索引
- SqlServer備份和恢復(二)SQLServer
- SqlServer 備份和恢復(一)SQLServer
- 阿里雲-同區域下不同VPC互訪阿里
- Holer實現Oracle外網訪問Oracle
- Oracle資料庫限制訪問IPOracle資料庫
- 整合手機平臺待辦資料失敗問題跟蹤和處理(Mongodb、Oracle、SQLServer)MongoDBOracleSQLServer
- Sqlserver查詢alwayson同步情況指令碼(2)SQLServer指令碼
- Powershell————2、Powershell互動式
- MYSQL和SQLServer效能監控指標MySqlServer指標
- SQLServer的檢查點、redo和undoSQLServer
- SQLserver-MySQL的區別和用法ServerMySql
- Sqlserver鎖升級的理解和例子SQLServer
- oracle event 2 (zt)Oracle
- Sqlserver限制賬戶在哪些ip下才可以訪問資料庫SQLServer資料庫
- 喪狗訪談:做“互動電影”的Cir
- 如何限制ip訪問Oracle資料庫Oracle資料庫
- Oracle/MySQL透過odbc訪問PostgreSQL for LightDBOracleMySql
- SqlServer2008R2登入出現問題SQLServer