多IP伺服器上監聽器的設定

space6212發表於2019-05-20

為了減少機器浪費,決定把分佈在兩個伺服器上的資料庫使用者資料合併到同一個伺服器上的同一個資料庫。


資料庫A和資料庫B的service_name都一樣,IP不一樣。

由於有不同的應用分佈在這兩個資料庫上,為了不影響這些程式的執行,需要把原來的兩個伺服器用到的IP都分配給新伺服器。相應的監聽檔案也應作相應的修改:

原監聽檔案:

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.107)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/9.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = mydb)
(ORACLE_HOME = /opt/oracle/product/9.2.0)
(SID_NAME = mysid)

新監聽檔案:

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.107)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.201)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/9.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = mydb)
(ORACLE_HOME = /opt/oracle/product/9.2.0)
(SID_NAME = mysid)
)
)

這樣,不用修改程式的資料庫連線,就可以正常執行原來的程式。整個資料庫合併對應用透明。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/231499/viewspace-63740/,如需轉載,請註明出處,否則將追究法律責任。

相關文章