乙個資料庫如何在不同埠上監聽

2021-05-24 06:44:06 字數 2674 閱讀 2454

由於收市後(**公司),預設的1521埠會被切斷,但是出於維護需要連線上這個資料庫。

客戶的想法是同乙個監聽2個埠,我的想法是2個監聽。在此記錄下2中不同的方式。

原listener.ora配置檔案:

# listener.ora network configuration file: /opt/oracle/db/db_1/network/admin/listener.ora

# generated by oracle configuration tools.

listener =

(description_list =

(description =

(address = (protocol = tcp)(host = gtlions)(port = 1521))))

adr_base_listener = /opt/oracle/db

1、乙個監聽對應2個埠 1521 1522

listener.ora配置如下:

# listener.ora network configuration file: /opt/oracle/db/db_1/network/admin/listener.ora

# generated by oracle configuration tools.

sid_list_listener =

(sid_list =

(sid_desc =

(global_dbname = test)

(oracle_home = /opt/oracle/db/db_1)

(sid_name = test)))

listener =

(description_list =

(description =

(address = (protocol = tcp)(host = gtlions)(port = 1521))

)(description =

(address = (protocol = tcp)(host = gtlions)(port = 1522))))

adr_base_listener = /opt/oracle/db

tnsnames.ora配置如下:

# tnsnames.ora network configuration file: /opt/oracle/db/db_1/network/admin/tnsnames.ora

# generated by oracle configuration tools.

test =

(description =

(address_list =

(address = (protocol = tcp)(host = 127.0.0.1)(port = 1521))

)(connect_data =

(service_name = test)))

test2 =

(description =

(address_list =

(address = (protocol = tcp)(host = 127.0.0.1)(port = 1522))

)(connect_data =

(service_name = test)))

測試通過test和test2均能夠連線和使用,但是stop掉監聽listener之後2個埠無法都無法使用。

2、2個監聽對應2個埠1521 1522

listener.ora配置如下:

# listener.ora network configuration file: /opt/oracle/db/db_1/network/admin/listener.ora

# generated by oracle configuration tools.

sid_list_listener =

(sid_list =

(sid_desc =

(global_dbname = test)

(oracle_home = /opt/oracle/db/db_1)

(sid_name = test)))

listener =

(description_list =

(description =

(address = (protocol = tcp)(host = gtlions)(port = 1521))))

sid_list_test =

(sid_list =

(sid_desc =

(global_dbname = test)

(oracle_home = /opt/oracle/db/db_1)

(sid_name = test)))

test =

(description_list =

(description =

(address = (protocol = tcp)(host = gtlions)(port = 1522))))

adr_base_listener = /opt/oracle/db

tnsnames.ora配置不變。

測試通過test和test2均能夠連線和使用,而且因為2個埠分別由2個listener管理,單獨停掉或被封住乙個埠並不影響另乙個埠使用。

小結第1種方式乙個監聽對應2個埠,帶來的問題是無法單獨關掉這個埠的監聽。

-the end-

oracle 如何在乙個資料庫建立多個例項

例項 是乙個非固定的 基於記憶體的基本程序與記憶體結構。當伺服器關閉後,例項也就不存在了。資料庫 database 指的是固定的 基於磁碟的資料檔案 控制檔案 日誌檔案 引數檔案和歸檔日誌檔案等。一般情況下,oracle資料庫都是乙個資料庫對應乙個例項。如下圖所示 當然可以根據需要建立多個資料庫和對...

如何用乙個資料庫的資料去更新另乙個資料庫的內容

愚翁 如何用乙個資料庫的資料去更新另乙個資料庫的內容 上次寫了乙個簡單資料庫之間資料交換的程式,但是考慮到如果資料量大的情況,我所使用的 dataadatper dataset 方法,在效能上就有很大的劣勢。不過,要想在資料量大的資料庫之間能高效地交換,就需要捨棄原先的方法,而改用 dbcomman...

伺服器程式如何在同乙個埠上處理多個客戶端的請求

假設有個web server,監聽80埠,有10個client訪問這個 都和這個 的80埠建立tcp連線,server是怎麼區分這10個client呢?首先我們是用這個五元組來唯一區別乙個連線的。所以回到上面的問題,多個客戶端訪問伺服器,雖然server的ip和埠是一樣的,但是client的ip和埠...