服務端配置一個多埠號(如1521/1526)監聽器
服務端的監聽器有多種配置方法:1、預設的情況下是一個監聽器一個埠,這個時候,
不需要在tnsnames.ora檔案裡解析監聽器資訊;2、多個監聽器多個埠(埠號可以相同),
這時候,需要在tnsnames.ora檔案裡解析監聽器資訊;3、一個監聽器多個埠號的監聽器,
這時候同樣需要在tnsnames.ora檔案裡解析監聽器資訊。
以下是測試第3種情況的過程:
----配置多埠號的監聽器:
---配置服務端 listener.ora檔案:
[oracle@enmo admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = enmo)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = enmo)(PORT = 1526))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1526))
)
)
---配置服務端 tnsnames.ora檔案:
[oracle@enmo admin]$ cat tnsnames.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = enmo)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = enmo)(PORT = 1526))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1526))
)
)
[oracle@enmo admin]$
#配置服務端 tnsnames.ora檔案是為了解析服務端LISTENER 監聽器有兩個埠號。
---在資料庫修改本地的監聽器:
sys@PROD>alter system set local_listener='LISTENER';
System altered.
#修改成功。
---啟動伺服器端的監聽器:
LSNRCTL> start
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/enmo/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=enmo.oracle.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=enmo.oracle.com)(PORT=1526)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1526)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 03-DEC-2016 23:34:15
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/enmo/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=enmo.oracle.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=enmo.oracle.com)(PORT=1526)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1526)))
The listener supports no services
The command completed successfully
LSNRCTL>
LSNRCTL>
---把資料庫主動註冊到監聽器:
sys@PROD>alter system register;
System altered.
sys@PROD>/
#註冊完成。
---註冊資料庫後檢視監聽器的狀態:
LSNRCTL> status
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 03-DEC-2016 23:34:15
Uptime 0 days 0 hr. 0 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/enmo/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=enmo.oracle.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=enmo.oracle.com)(PORT=1526)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1526)))
Services Summary...
Service "PROD" has 1 instance(s).
Instance "PROD", status READY, has 1 handler(s) for this service...
Service "PRODXDB" has 1 instance(s).
Instance "PROD", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
---Windows客戶端透過EZCONNECT使用1521埠連線服務端資料庫測試:
C:\Users\Asus>sqlplus sys/oracle@192.168.2.6:1521/PROD as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期六 12月 3 23:58:14 2016
Copyright (c) 1982, 2010, Oracle. All rights reserved.
連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>
SQL> show parameter service
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
service_names string
PROD
#連線成功,證明多埠的監聽器配置成功。
---Windows客戶端透過EZCONNECT使用1526埠連線服務端資料庫測試:
C:\Users\Asus>sqlplus sys/oracle@192.168.2.6:1526/PROD as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 12月 4 00:00:17 2016
Copyright (c) 1982, 2010, Oracle. All rights reserved.
連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter service
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
service_names string
PROD
#連線成功,證明多埠的監聽器配置成功。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2130339/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 修改服務端監聽器埠號為1526服務端
- 如何配置多個監聽器不同埠
- oracle 監聽配置多個埠Oracle
- Oracle 建立非1521埠監聽Oracle
- 【LISTENER】一個資料庫配置兩個監聽埠號資料庫
- 【監聽】配置服務端靜態(動態)監聽/修改監聽埠及引數local_listener作用服務端
- ORACLE 動態註冊,靜態註冊,多個監聽,一個監聽多個埠配置Oracle
- ORACLE 修改11.2.0.4 RAC 預設監聽埠號1521為1621Oracle
- 【Oracle】修改scan監聽器埠號Oracle
- oracle監聽【非1521埠】動態註冊Oracle
- nginx 80埠監聽多個域名Nginx
- oracle 11g 修改預設監聽埠1521Oracle
- Tomcat內配置多個webapps監聽不同埠TomcatWebAPP
- 伺服器端監聽器配置伺服器
- wriesharek同時監聽多個埠
- 如何發現遠端伺服器上某埠正在監聽的ORACLE例項/服務伺服器Oracle
- 【LISTENER】修改 LISTENER的監聽埠為1526(動態註冊)
- 【LISTENER】修改 LISTENER的監聽埠為1526(靜態註冊)
- oracle rac scan監聽更改埠號Oracle
- npmscript命令同時開啟多個監聽服務concurrentlyNPM
- oracle更改預設埠號,監聽器加密,限制ip訪問Oracle加密
- oracle 監聽器配置Oracle
- Android Service 服務的應用之電話監聽器以及簡訊監聽器Android
- frp配置本地服務埠到伺服器80埠FRP伺服器
- 如何更改oracle監聽器的埠Oracle
- Spring框架(一):配置&注入&監聽器Spring框架
- 遠端控制監聽器
- [20161227]開啟多個監聽埠.txt
- oracle一個例項配置多個listener或多個埠Oracle
- Oracle監聽器中的XDB、XPT和PLSExtProc服務Oracle
- 同一Server上兩個資料庫例項共用listener.ora ,監聽多個埠Server資料庫
- Oracle之 11gR2 RAC 修改監聽器埠號的步驟Oracle
- 常用埠號及對應服務
- ssh遠端埠轉發無法監聽0.0.0.0
- oracle監聽不到例項服務Oracle
- oracle一個別例項配置多個listener或多個埠Oracle
- 2020-09-30Socket 一個伺服器監聽多個客戶端 功能實現伺服器客戶端
- 【go】【rpc】【同一埠,提供多種服務】GoRPC