oracle之 單例項監聽修改埠
Oracle 單一主機多個例項多個監聽器配置要點
1. 一臺伺服器主機, 有多個例項, 如: TSDB/ORCL; 又需要配置多個監聽器
2. 需要指定不同的LISTENER埠
3.pmon只會動態註冊port等於1521的監聽器, 其它埠則pmon不能動態註冊listener, 要想讓pmon動態註冊listener, 需要設定local_listener引數
[oracle@12c01 admin]$ cat listener.ora
ANDYCDB =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ANDYCDB_TEST =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1522))
)
)
[oracle@12c01 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ANDYCDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = andycdb)
)
)
LISTENER_ANDYCDB =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521))
PDB01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdb01)
)
)
LISTENER_PDB01 =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521)
LISTENER_TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1522))
)
#################
lsnrctl操作:
LSNRCTL> set current_listener ANDYCDB_TEST
Current Listener is ANDYCDB_TEST
LSNRCTL> start
Starting /home/oracle/app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /home/oracle/app/oracle/diag/tnslsnr/12c01/andycdb_test/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=12c01)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ANDYCDB_TEST
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 10-APR-2018 21:59:17
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/12c01/andycdb_test/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1522)))
The listener supports no services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=12c01)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ANDYCDB_TEST
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 10-APR-2018 21:59:17
Uptime 0 days 0 hr. 1 min. 26 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/12c01/andycdb_test/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1522)))
The listener supports no services
The command completed successfully
-- 設定一個監聽埠
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1522))';
System altered.
[oracle@12c01 admin]$ lsnrctl status andycdb_test
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 10-APR-2018 22:38:32
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=12c01)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ANDYCDB_TEST
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 10-APR-2018 21:59:17
Uptime 0 days 0 hr. 39 min. 16 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/12c01/andycdb_test/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1522)))
Services Summary...
Service "4f44590eb7b74390e0531018db0a1976" has 1 instance(s).
Instance "andycdb", status READY, has 1 handler(s) for this service...
Service "andycdb" has 1 instance(s).
Instance "andycdb", status READY, has 1 handler(s) for this service...
Service "andycdbXDB" has 1 instance(s).
Instance "andycdb", status READY, has 1 handler(s) for this service...
Service "pdb01" has 1 instance(s).
Instance "andycdb", status READY, has 1 handler(s) for this service...
The command completed successfully
-- 設定多個監聽埠
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1522)),(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1521)))';
System altered.
1. 一臺伺服器主機, 有多個例項, 如: TSDB/ORCL; 又需要配置多個監聽器
2. 需要指定不同的LISTENER埠
3.pmon只會動態註冊port等於1521的監聽器, 其它埠則pmon不能動態註冊listener, 要想讓pmon動態註冊listener, 需要設定local_listener引數
[oracle@12c01 admin]$ cat listener.ora
ANDYCDB =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ANDYCDB_TEST =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1522))
)
)
[oracle@12c01 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ANDYCDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = andycdb)
)
)
LISTENER_ANDYCDB =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521))
PDB01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdb01)
)
)
LISTENER_PDB01 =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1521)
LISTENER_TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1522))
)
#################
lsnrctl操作:
LSNRCTL> set current_listener ANDYCDB_TEST
Current Listener is ANDYCDB_TEST
LSNRCTL> start
Starting /home/oracle/app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /home/oracle/app/oracle/diag/tnslsnr/12c01/andycdb_test/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=12c01)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ANDYCDB_TEST
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 10-APR-2018 21:59:17
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/12c01/andycdb_test/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1522)))
The listener supports no services
The command completed successfully
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=12c01)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ANDYCDB_TEST
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 10-APR-2018 21:59:17
Uptime 0 days 0 hr. 1 min. 26 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/12c01/andycdb_test/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1522)))
The listener supports no services
The command completed successfully
-- 設定一個監聽埠
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1522))';
System altered.
[oracle@12c01 admin]$ lsnrctl status andycdb_test
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 10-APR-2018 22:38:32
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=12c01)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ANDYCDB_TEST
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 10-APR-2018 21:59:17
Uptime 0 days 0 hr. 39 min. 16 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/12c01/andycdb_test/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1522)))
Services Summary...
Service "4f44590eb7b74390e0531018db0a1976" has 1 instance(s).
Instance "andycdb", status READY, has 1 handler(s) for this service...
Service "andycdb" has 1 instance(s).
Instance "andycdb", status READY, has 1 handler(s) for this service...
Service "andycdbXDB" has 1 instance(s).
Instance "andycdb", status READY, has 1 handler(s) for this service...
Service "pdb01" has 1 instance(s).
Instance "andycdb", status READY, has 1 handler(s) for this service...
The command completed successfully
-- 設定多個監聽埠
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 12c01)(PORT = 1522)),(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=12c01)(PORT=1521)))';
System altered.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31383567/viewspace-2152760/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Oracle】修改oracle監聽埠Oracle
- 【Oracle】修改scan監聽器埠號Oracle
- Oracle 11g 修改監聽埠Oracle
- Oracle 修改預設監聽埠故障分析Oracle
- oracle例項和監聽器Oracle
- Oracle資料庫修改LISTENER的監聽埠Oracle資料庫
- oracle監聽不到例項服務Oracle
- oracle 多個例項監聽不到Oracle
- [20160418]修改oracle監聽埠.txtOracle
- 修改oracle監聽佔用的8080埠(轉)Oracle
- canal同步mysql,監聽單例項,多例項配置MySql單例
- oracle 多個例項安裝監聽Oracle
- Oracle之 11gR2 RAC 修改監聽器埠號的步驟Oracle
- oracle 11g 修改預設監聽埠1521Oracle
- [20130422]修改oracle監聽埠.txtOracle
- 12C RAC 修改監聽埠
- oracle 監聽配置多個埠Oracle
- oracle 修改ORACLE例項Oracle
- 如何發現遠端伺服器上某埠正在監聽的ORACLE例項/服務伺服器Oracle
- oracle rac scan監聽更改埠號Oracle
- Oracle 建立非1521埠監聽Oracle
- 如何更改oracle監聽器的埠Oracle
- js監聽鍵盤事件程式碼例項例項JS事件
- ASM例項配置監聽和TNSASM
- ORACLE 修改11.2.0.4 RAC 預設監聽埠號1521為1621Oracle
- 【監聽】配置服務端靜態(動態)監聽/修改監聽埠及引數local_listener作用服務端
- 主機名修改為IP地址後LISTENER無法監聽到例項
- 使用 vue 例項更好的監聽事件Vue事件
- 基於laravel的事件監聽例項Laravel事件
- Oracle 19C 監聽無法動態註冊例項Oracle
- Windows server 防火牆開放oracle監聽埠WindowsServer防火牆Oracle
- 修改服務端監聽器埠號為1526服務端
- 單例與單例項之爭單例
- oracle監聽【非1521埠】動態註冊Oracle
- 初始化監聽埠
- zabbix監控單例項redis單例Redis
- 同一Server上兩個資料庫例項共用listener.ora ,監聽多個埠Server資料庫
- Python實現遠端埠監控例項Python