如何在Oracle裡設置訪問多個SQL Server數據庫?假設我們要在ORACLE裡同時能訪問SQL Server裡默認的pubs和Northwind兩個數據庫。
1、在安裝了ORACLE9i Standard Edition或者ORACLE9i Enterprise Edition的windows機器上(IP:192.168.0.2), 產品要選了透明網關(Oracle Transparent Gateway)裡訪問Microsoft SQL Server數據庫
$ORACLE9I_HOME g4msqladmin下新寫initpubs.ora和initnorthwind.ora配置文件.
initpubs.ora內容如下:
HS_FDS_CONNECT_INFO="SERVER=SQLSERVER_HOSTNMAE;DATABASE=pubs"
HS_DB_NAME=pubs
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
initnorthwind.ora內容如下:
HS_FDS_CONNECT_INFO="SERVER=sqlserver_hostname;DATABASE=Northwind"
HS_DB_NAME=Northwind
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
$ORACLE9I_HOME etworkadmin 下listener.ora內容如下:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test9)
(ORACLE_HOME = d:oracleora92)
(SID_NAME = test9)
)