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 rac scan監聽更改埠號Oracle
- oracle之 單例項監聽修改埠Oracle單例
- Oracle 修改預設監聽埠故障分析Oracle
- 初始化監聽埠
- samba程序與監聽埠Samba
- oracle靜態監聽Oracle
- JMS監聽Oracle AQOracle
- windows10怎麼檢視監聽埠_windows10檢視監聽埠的方法Windows
- 12C RAC 修改監聽埠
- nginx 80埠監聽多個域名Nginx
- Vue3.0的遞迴監聽和非遞迴監聽Vue遞迴
- oracle netca建立監聽報錯/u01/oracle/bin/netca: line 178: 11819 AbortedOracle
- Oracle dblink監聽問題Oracle
- 6、oracle網路(監聽)Oracle
- shell埠監聽異常郵箱告警
- 使用java程式,監聽tcp協議埠JavaTCP協議
- Oracle 監聽異常處理Oracle
- Oracle啟動兩個監聽Oracle
- Oracle 監聽投毒COST解決Oracle
- nginx建立和監聽套接字分析Nginx
- oracle監聽不到例項服務Oracle
- linux系統中監聽埠概念是什麼?Linux
- ssh遠端埠轉發無法監聽0.0.0.0
- Android studio(建立、監聽器intent選單)AndroidIntent
- Oracle 11g RAC 監聽日常管理Oracle
- oracle 最全的監聽、tnsnames.ora格式Oracle
- zabbix-agent啟動之後10050埠未監聽
- 監聽 watch props物件屬性監聽 或深度監聽物件
- oracle rac的scan監聽狀態Not All Endpoints RegisteredOracle
- 【LISTENER】Oracle通過監聽連線緩慢分析Oracle
- Oracle 12c 手動建立CDB和非CDBOracle
- 【解決uniapp】audio seek失效,seeked監聽不到 createInnerAudioContext建立APPContext
- 獲取執行埠監聽的使用者身份auth-owner
- Oracle監聽器中的XDB、XPT和PLSExtProc服務Oracle
- watch監聽
- 2.5.4. 測試Oracle net——2.5.4.1. 啟動監聽程式Oracle
- 預設非安全埠列表