Oracle 建立非1521埠監聽
現有的監聽檔案配置
點選(此處)摺疊或開啟
-
[oracle@test-db 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 = test-db)(PORT = 1521))
-
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
-
)
-
)
-
-
ADR_BASE_LISTENER = /u01/app/oracle
-
-
-
-
SID_LIST_LISTENER =
-
(SID_LIST =
-
(SID_DESC =
-
(GLOBAL_DBNAME=orcl)
-
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
-
(SID_NAME = orcl)
-
)
- )
目前的監聽狀態
點選(此處)摺疊或開啟
-
[oracle@test-db admin]$ lsnrctl status
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 04-APR-2018 00:09:29
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-db)(PORT=1521)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
-
Start Date 03-APR-2018 23:30:31
-
Uptime 0 days 0 hr. 38 min. 57 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/test-db/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test-db)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
Services Summary...
-
Service "orcl" has 1 instance(s).
-
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
-
Service "orclXDB" has 1 instance(s).
-
Instance "orcl", status READY, has 1 handler(s) for this service...
-
Service "primary_orcl" has 1 instance(s).
-
Instance "orcl", status READY, has 1 handler(s) for this service...
- The command completed successfully
----------------------------------分隔線-----------------------------------------
在listener.ora檔案中新增1522埠的監聽,新增後的檔案內容如下
點選(此處)摺疊或開啟
-
[oracle@test-db 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 = test-db)(PORT = 1521))
-
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
-
)
-
)
-
-
ADR_BASE_LISTENER = /u01/app/oracle
-
-
-
-
SID_LIST_LISTENER =
-
(SID_LIST =
-
(SID_DESC =
-
(GLOBAL_DBNAME=orcl)
-
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
-
(SID_NAME = orcl)
-
)
-
)
-
-
-
#1522
-
MY_LISTENER =
-
(DESCRIPTION_LIST =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = test-db)(PORT = 1522))
-
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
-
)
-
)
-
-
#用於在1522埠註冊服務
-
SID_LIST_MY_LISTENER =
-
(SID_LIST =
-
(SID_DESC =
-
(GLOBAL_DBNAME=orcl)
-
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
-
(SID_NAME = orcl)
-
)
- )
啟動1522埠監聽
點選(此處)摺疊或開啟
-
[oracle@test-db admin]$ lsnrctl start my_listener
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 04-APR-2018 00:16:18
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
-
-
TNSLSNR for Linux: Version 11.2.0.3.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/test-db/my_listener/alert/log.xml
-
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test-db)(PORT=1522)))
-
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-db)(PORT=1522)))
-
STATUS of the LISTENER
-
------------------------
-
Alias my_listener
-
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
-
Start Date 04-APR-2018 00:16:18
-
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/test-db/my_listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test-db)(PORT=1522)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
-
Services Summary...
-
Service "orcl" has 1 instance(s).
-
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
- The command completed successfully
使用PLSQL Developer工具測試可以正常連線。
-----------------------分割線----------------------------
在1522埠註冊伺服器還有一種方法,就是使用tnsnames.ora檔案
在去掉了listener.ora中有關 SID_LIST_MY_LISTENER 靜態註冊的程式碼後,重啟my_listener監聽發現沒有任何服務註冊
點選(此處)摺疊或開啟
-
[oracle@test-db admin]$ lsnrctl start my_listener
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 04-APR-2018 00:18:08
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
-
-
TNSLSNR for Linux: Version 11.2.0.3.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/test-db/my_listener/alert/log.xml
-
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test-db)(PORT=1522)))
-
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-db)(PORT=1522)))
-
STATUS of the LISTENER
-
------------------------
-
Alias my_listener
-
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
-
Start Date 04-APR-2018 00:18:08
-
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/test-db/my_listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test-db)(PORT=1522)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
-
The listener supports no services
- The command completed successfully
在tnsnames.ora檔案中新增如下程式碼
點選(此處)摺疊或開啟
-
my_orcl =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = test-db)(PORT = 1522))
-
(ADDRESS = (PROTOCOL = TCP)(HOST = test-db)(PORT = 1521))
-
(CONNECT_DATA =
-
(SERVER = DEDICATED)
-
(SERVICE_NAME = orcl)
-
)
- )
注:如果不新增(ADDRESS = (PROTOCOL = TCP)(HOST = test-db)(PORT = 1521))這段的話,那麼在預設1521埠中將不會有服務註冊
點選(此處)摺疊或開啟
- alter system set local_listener='my_orcl' scope=both;
使用命令分別檢查監聽狀態
點選(此處)摺疊或開啟
-
[oracle@test-db admin]$ lsnrctl status
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 04-APR-2018 00:32:38
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-db)(PORT=1521)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
-
Start Date 03-APR-2018 23:30:31
-
Uptime 0 days 1 hr. 2 min. 6 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/test-db/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test-db)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
-
Services Summary...
-
Service "orcl" has 1 instance(s).
-
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
-
Service "orclXDB" has 1 instance(s).
-
Instance "orcl", status READY, has 1 handler(s) for this service...
-
Service "primary_orcl" has 1 instance(s).
-
Instance "orcl", status READY, has 1 handler(s) for this service...
-
The command completed successfully
-
[oracle@test-db admin]$ lsnrctl status my_listener
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 04-APR-2018 00:32:45
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test-db)(PORT=1522)))
-
STATUS of the LISTENER
-
------------------------
-
Alias my_listener
-
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
-
Start Date 04-APR-2018 00:18:08
-
Uptime 0 days 0 hr. 14 min. 37 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/test-db/my_listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test-db)(PORT=1522)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
-
Services Summary...
-
Service "orclXDB" has 1 instance(s).
-
Instance "orcl", status READY, has 1 handler(s) for this service...
-
Service "primary_orcl" has 1 instance(s).
-
Instance "orcl", status READY, has 1 handler(s) for this service...
- The command completed successfully
使用PLSQL Developer工具測試可以正常連線。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/2317695/viewspace-2152591/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle監聽【非1521埠】動態註冊Oracle
- oracle 11g 修改預設監聽埠1521Oracle
- ORACLE 修改11.2.0.4 RAC 預設監聽埠號1521為1621Oracle
- 【Oracle】修改oracle監聽埠Oracle
- 實現Oracle非1521標準埠動態註冊Oracle
- oracle 監聽配置多個埠Oracle
- oracle rac scan監聽更改埠號Oracle
- 【Oracle】修改scan監聽器埠號Oracle
- Oracle 11g 修改監聽埠Oracle
- 如何更改oracle監聽器的埠Oracle
- 服務端配置一個多埠號(如1521/1526)監聽器服務端
- Oracle 修改預設監聽埠故障分析Oracle
- oracle之 單例項監聽修改埠Oracle單例
- 預設及非預設埠的動態監聽/靜態監聽實驗彙總
- Windows server 防火牆開放oracle監聽埠WindowsServer防火牆Oracle
- Oracle資料庫修改LISTENER的監聽埠Oracle資料庫
- [20160418]修改oracle監聽埠.txtOracle
- 修改oracle監聽佔用的8080埠(轉)Oracle
- 初始化監聽埠
- samba程序與監聽埠Samba
- Oracle安裝之1521埠及任何埠被佔用錯誤Oracle
- Oracle RAC 11gR2 SCAN IP和VIP共用1521監聽埠引發的ORA-12520問題Oracle
- [20130422]修改oracle監聽埠.txtOracle
- Sqlserver重啟alwayson監聽埠SQLServer
- Oracle 監聽Oracle
- ORACLE 動態註冊,靜態註冊,多個監聽,一個監聽多個埠配置Oracle
- Vue3.0的遞迴監聽和非遞迴監聽Vue遞迴
- windows10怎麼檢視監聽埠_windows10檢視監聽埠的方法Windows
- 12C RAC 修改監聽埠
- nginx 80埠監聽多個域名Nginx
- Tomcat監聽443埠的方法Tomcat
- oracle更改預設埠號,監聽器加密,限制ip訪問Oracle加密
- Oracle監聽(1)Oracle
- ORACLE動態監聽與靜態監聽Oracle
- oracle靜態監聽和動態監聽Oracle
- 【oracle】動態監聽與靜態監聽Oracle
- 使用java程式,監聽tcp協議埠JavaTCP協議
- shell埠監聽異常郵箱告警