【LISTENER】實現將資料庫例項同時動態註冊到兩個非預設監聽埠
本文給出將資料庫例項同時動態註冊到兩個非預設監聽埠的手工配置方法。
1.編寫listener.ora檔案給出1526和1528兩個非預設埠監聽配置
ora10g@secdb /home/oracle$ vi $ORACLE_HOME/network/admin/listener.ora
listener_1526=
(description=
(address=(protocol=tcp)(host=secdb)(port=1526)))
listener_1528=
(description=
(address=(protocol=tcp)(host=secdb)(port=1528)))
~
~
2.同時啟動兩個非預設埠監聽器
1)啟動監聽埠為1526的監聽器listener_1526
ora10g@secdb /home/oracle$ lsnrctl start listener_1526
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 15-MAY-2011 22:08:25
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1526.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1526)))
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1526)))
STATUS of the LISTENER
------------------------
Alias listener_1526
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 15-MAY-2011 22:08:25
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1526.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1526)))
The listener supports no services
The command completed successfully
2)啟動監聽埠為1528的監聽器listener_1528
ora10g@secdb /home/oracle$ lsnrctl start listener_1528
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 15-MAY-2011 22:08:28
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1528.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1528)))
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1528)))
STATUS of the LISTENER
------------------------
Alias listener_1528
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 15-MAY-2011 22:08:28
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1528.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1528)))
The listener supports no services
The command completed successfully
3.配置tnsnames.ora檔案
ora10g@secdb /home/oracle$ vi $ORACLE_HOME/network/admin/tnsnames.ora
listener_ora10g =
(ADDRESS_LIST =
(address = (protocol = tcp)(host = secdb)(port = 1526))
(address = (protocol = tcp)(host = secdb)(port = 1528))
)
ora10g_1526=
(description=
(address=(protocol=tcp)(host=secdb)(port=1526))
(connect_data=
(service_name=ora10g)))
ora10g_1528=
(description=
(address=(protocol=tcp)(host=secdb)(port=1528))
(connect_data=
(service_name=ora10g)))
~
~
其中“listener_ora10g”使用者在資料庫例項中設定local_listener引數實現動態註冊;“ora10g_1526”是用於測試1526埠是否可用的連線串;“ora10g_1528”是用於測試1528埠是否可用的連線串.
4.在資料庫例項中透過修改local_listener引數實現動態註冊
sys@ora10g> show parameter local_listener
NAME TYPE VALUE
--------------------------- -------------------- ------------------
local_listener string
sys@ora10g> alter system set local_listener='listener_ora10g';
System altered.
sys@ora10g> show parameter local_listener
NAME TYPE VALUE
--------------------------- -------------------- ------------------
local_listener string listener_ora10g
5.檢視1526以及1528埠監聽狀態
1)檢視1526埠監聽狀態
ora10g@secdb /home/oracle$ lsnrctl status listener_1526
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 15-MAY-2011 22:13:27
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1526)))
STATUS of the LISTENER
------------------------
Alias listener_1526
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 15-MAY-2011 22:08:25
Uptime 0 days 0 hr. 5 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1526.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1526)))
Services Summary...
Service "ora10g" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
The command completed successfully
狀態顯示,1526埠已經能夠成功監聽到ora10g例項。
2)檢視1528埠監聽狀態
ora10g@secdb /home/oracle$ lsnrctl status listener_1528
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 15-MAY-2011 22:13:34
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1528)))
STATUS of the LISTENER
------------------------
Alias listener_1528
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 15-MAY-2011 22:08:28
Uptime 0 days 0 hr. 5 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1528.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1528)))
Services Summary...
Service "ora10g" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
The command completed successfully
狀態顯示,1528埠也已經能夠同時監聽到ora10g例項。
註釋:如果短時間內例項沒有完成自動註冊,可以使用如下命令加速動態註冊。
sys@ora10g> alter system register;
6.測試1526以及1528埠是否可用
1)使用ora10g_1526連線串測試1526埠是否可用
ora10g@secdb /home/oracle$ sqlplus system/oracle@ora10g_1526
SQL*Plus: Release 10.2.0.1.0 - Production on Sun May 15 22:15:22 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
system@ora10g>
使用監聽器1526埠成功連線到資料庫例項。
2)使用ora10g_1528連線串測試1528埠是否可用
ora10g@secdb /home/oracle$ sqlplus system/oracle@ora10g_1528
SQL*Plus: Release 10.2.0.1.0 - Production on Sun May 15 22:15:29 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
system@ora10g>
使用監聽器1528埠成功連線到資料庫例項。
到此,我們便實現了將資料庫例項同時註冊到兩個非預設埠這個任務。
7.小結
透過調整listener.ora和tnsnames.ora檔案可以實現監聽器的多種配置方法,本文給出的是實現將資料庫例項同時動態註冊到兩個非預設監聽埠的方法。大家可以嘗試給出其他的實現方法。
Good luck.
secooler
11.05.15
-- The End --
1.編寫listener.ora檔案給出1526和1528兩個非預設埠監聽配置
ora10g@secdb /home/oracle$ vi $ORACLE_HOME/network/admin/listener.ora
listener_1526=
(description=
(address=(protocol=tcp)(host=secdb)(port=1526)))
listener_1528=
(description=
(address=(protocol=tcp)(host=secdb)(port=1528)))
~
~
2.同時啟動兩個非預設埠監聽器
1)啟動監聽埠為1526的監聽器listener_1526
ora10g@secdb /home/oracle$ lsnrctl start listener_1526
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 15-MAY-2011 22:08:25
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1526.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1526)))
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1526)))
STATUS of the LISTENER
------------------------
Alias listener_1526
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 15-MAY-2011 22:08:25
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1526.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1526)))
The listener supports no services
The command completed successfully
2)啟動監聽埠為1528的監聽器listener_1528
ora10g@secdb /home/oracle$ lsnrctl start listener_1528
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 15-MAY-2011 22:08:28
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1528.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1528)))
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1528)))
STATUS of the LISTENER
------------------------
Alias listener_1528
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 15-MAY-2011 22:08:28
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1528.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1528)))
The listener supports no services
The command completed successfully
3.配置tnsnames.ora檔案
ora10g@secdb /home/oracle$ vi $ORACLE_HOME/network/admin/tnsnames.ora
listener_ora10g =
(ADDRESS_LIST =
(address = (protocol = tcp)(host = secdb)(port = 1526))
(address = (protocol = tcp)(host = secdb)(port = 1528))
)
ora10g_1526=
(description=
(address=(protocol=tcp)(host=secdb)(port=1526))
(connect_data=
(service_name=ora10g)))
ora10g_1528=
(description=
(address=(protocol=tcp)(host=secdb)(port=1528))
(connect_data=
(service_name=ora10g)))
~
~
其中“listener_ora10g”使用者在資料庫例項中設定local_listener引數實現動態註冊;“ora10g_1526”是用於測試1526埠是否可用的連線串;“ora10g_1528”是用於測試1528埠是否可用的連線串.
4.在資料庫例項中透過修改local_listener引數實現動態註冊
sys@ora10g> show parameter local_listener
NAME TYPE VALUE
--------------------------- -------------------- ------------------
local_listener string
sys@ora10g> alter system set local_listener='listener_ora10g';
System altered.
sys@ora10g> show parameter local_listener
NAME TYPE VALUE
--------------------------- -------------------- ------------------
local_listener string listener_ora10g
5.檢視1526以及1528埠監聽狀態
1)檢視1526埠監聽狀態
ora10g@secdb /home/oracle$ lsnrctl status listener_1526
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 15-MAY-2011 22:13:27
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1526)))
STATUS of the LISTENER
------------------------
Alias listener_1526
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 15-MAY-2011 22:08:25
Uptime 0 days 0 hr. 5 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1526.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1526)))
Services Summary...
Service "ora10g" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
The command completed successfully
狀態顯示,1526埠已經能夠成功監聽到ora10g例項。
2)檢視1528埠監聽狀態
ora10g@secdb /home/oracle$ lsnrctl status listener_1528
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 15-MAY-2011 22:13:34
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1528)))
STATUS of the LISTENER
------------------------
Alias listener_1528
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 15-MAY-2011 22:08:28
Uptime 0 days 0 hr. 5 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener_1528.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1528)))
Services Summary...
Service "ora10g" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
The command completed successfully
狀態顯示,1528埠也已經能夠同時監聽到ora10g例項。
註釋:如果短時間內例項沒有完成自動註冊,可以使用如下命令加速動態註冊。
sys@ora10g> alter system register;
6.測試1526以及1528埠是否可用
1)使用ora10g_1526連線串測試1526埠是否可用
ora10g@secdb /home/oracle$ sqlplus system/oracle@ora10g_1526
SQL*Plus: Release 10.2.0.1.0 - Production on Sun May 15 22:15:22 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
system@ora10g>
使用監聽器1526埠成功連線到資料庫例項。
2)使用ora10g_1528連線串測試1528埠是否可用
ora10g@secdb /home/oracle$ sqlplus system/oracle@ora10g_1528
SQL*Plus: Release 10.2.0.1.0 - Production on Sun May 15 22:15:29 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
system@ora10g>
使用監聽器1528埠成功連線到資料庫例項。
到此,我們便實現了將資料庫例項同時註冊到兩個非預設埠這個任務。
7.小結
透過調整listener.ora和tnsnames.ora檔案可以實現監聽器的多種配置方法,本文給出的是實現將資料庫例項同時動態註冊到兩個非預設監聽埠的方法。大家可以嘗試給出其他的實現方法。
Good luck.
secooler
11.05.15
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-696106/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 動態註冊監聽Listener
- oracle監聽【非1521埠】動態註冊Oracle
- 【LISTENER】修改 LISTENER的監聽埠為1526(動態註冊)
- 同一Server上兩個資料庫例項共用listener.ora ,監聽多個埠Server資料庫
- 【LISTENER】一個資料庫配置兩個監聽埠號資料庫
- ORACLE 動態註冊,靜態註冊,多個監聽,一個監聽多個埠配置Oracle
- 預設及非預設埠的動態監聽/靜態監聽實驗彙總
- 【LISTENER】修改 LISTENER的監聽埠為1526(靜態註冊)
- oracle 監聽器動態與靜態註冊服務_listenerOracle
- Oracle資料庫修改LISTENER的監聽埠Oracle資料庫
- 監聽動態註冊
- 動態註冊監聽
- 動態監聽註冊
- Oracle 19C 監聽無法動態註冊例項Oracle
- 【監聽】動態註冊和靜態註冊
- 實現Oracle非1521標準埠動態註冊Oracle
- rac監聽動態註冊
- Oracle 動態監聽註冊Oracle
- oracle監聽靜態註冊和動態註冊Oracle
- oracle監聽動態註冊與靜態註冊Oracle
- Oracle監聽的靜態註冊和動態註冊Oracle
- Oracle監聽的動態註冊與靜態註冊Oracle
- 同時配置動態監聽與靜態監聽
- rac監聽不能動態註冊
- wriesharek同時監聽多個埠
- oracle 12c 資料庫例項監聽無法註冊問題一例Oracle資料庫
- oracle監聽動態註冊與靜態註冊[轉帖]Oracle
- Oracle動態監聽註冊測試Oracle
- HPUX 監聽無法動態註冊UX
- listener的動態註冊
- Oracle Listener 動態註冊 與 靜態註冊Oracle
- Oracle listener靜態註冊和動態註冊Oracle
- Oracle Listener 動態註冊與靜態註冊Oracle
- 【LISTENER】使用“alter system register;”解決動態監聽註冊緩慢問題
- 【監聽】配置服務端靜態(動態)監聽/修改監聽埠及引數local_listener作用服務端
- oracle監聽之動態和靜態註冊Oracle
- listener靜態註冊和動態註冊總結
- 例項動態註冊跟蹤