Remember before the original Oracle engineers in the routine inspection found an Oracle database server on the start of two listening, respectively, 1521 and 1581 ports, and two ports are in use, then as a strange phenomenon, did not understand why. In recent days, looking at the documentation for the Oracle network configuration, inadvertently launched two listeners on the virtual machine, and then remembered the previous issue. What is the reason for it?
The following first to restore the entire process.
It was a practice of configuring static listening, and a static listener was configured in Listener.ora:
ORCL = (description= (address_list= (address= (protocol=tcp) (host=192.168.56.2) (port=1581)) sid_list_orcl= (SID_LI St= (sid_desc= (GLOBAL_DBNAME=ORCL) (ORACLE_HOME=/U02/APP/ORACLE/PRODUCT/11.2.4/DB1) (SID_NAME=ORCL)))
Start Normal:
[[email protected] admin]$ lsnrctl start orcllsnrctl for linux: version 11.2.0.4.0 - production on 03-jun-2017 16:22:41copyright (c) 1991, 2013, oracle. all rights reserved. Starting /u02/app/oracle/product/11.2.4/db1/bin/tnslsnr: please wait ... tnslsnr for linux: version 11.2.0.4.0 - productionsystem parameter File is /u02/app/oracle/product/11.2.4/db1/network/admin/listener.oralog messages written to /u02/app/oracle/diag/tnslsnr/rhel6/orcl/alert/log.xmlListening on: (description= ( Address= (PROTOCOL=TCP) (host=192.168.56.2) (port=1581)) connecting to (description= (ADDRESS= (PROTOCOL= TCP) (host=192.168.56.2) (port=1581)) Status of the listener------------------------alias orclversion tnslsnr for linux: version 11.2.0.4.0 - ProductionStart Date 03-JUN-2017 16:22:41Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP offlistener parameter file /u02/app/oracle/product/11.2.4/db1/network/admin/listener.oralistener log file /u02/app/oracle/diag/tnslsnr/rhel6/orcl/alert/log.xmllistening Endpoints Summary... (description= (address= (protocol=tcp) (host=192.168.56.2) (port=1581)) ) Services summary ... service "ORCL" has 1 instance (s) . instance "ORCL", status Unknown, has 1 handler (s) for this service ... The command completed successfully
Remote Test Connection succeeded
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/97/C3/wKioL1kycoOAJpDsAAApXIpAtIY883.png "title=" 1.PNG "alt=" Wkiol1kycooajpdsaaapxipatiy883.png "/>
At this time, the Lsnrctl start command, "magical" things happened, another monitoring up:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/97/C3/wKioL1kycxSRqwiCAACdyUHkHT8195.png "title=" 1.PNG "alt=" wkiol1kycxsrqwicaacdyuhkht8195.png "/> Use NETSTAT-NLTP port, two ports are monitored status:
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/97/C3/wKioL1kyc5TyjnA1AAAl7pJ9NaM880.png "title=" 1.PNG "alt=" Wkiol1kyc5tyjna1aaal7pj9nam880.png "/> Now remote test connection, incredibly can also connect success
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/97/C3/wKioL1kyc9qQecbcAAAXGCgc25g054.png "title=" 1.PNG "alt=" Wkiol1kyc9qqecbcaaaxgcgc25g054.png "/>
So now the problem is, why can start two listening, and two listening can be used? And I did not configure the 1521-port monitoring in the Listener.ora, why can I start 1521 listening?
Let's look at the second question, why you started listening on port 1521, and found a message from the official documentation:
Because all of the configuration parameters has default values, it is possible to start
and use a listener with no configuration. This default listener has a name of listener,
Supports no services on startup, and listens on the following TCP/IP protocol address:
(Address= (PROTOCOL=TCP) (host=host_name) (port=1521))
This sentence will explain why the 1521-port monitoring is initiated. I also did the experiment, even if there is no Listener.ora file in the case, you can start the listener named listener to listen to 1521 port.
Explain the problem of listening, and then look at the first question, why two monitoring can be used?
Let's look at dynamic monitoring and static monitoring:
Dynamic listening is when the database starts, the Pmon process registers the service information to the local port, which is registered to port 1521 on the local address by default. And the front start of the 1521 port monitoring is in line with the default registration method, so directly can be registered successfully, the database can also provide services to the outside.
And the first configuration of the static monitoring is to replace the Pmon process registration work, directly to the database to bind the service to the listener, even if the database does not start, the database service name will be displayed in the listener.
Understanding these before, it is not difficult to understand why two monitoring can be used at the same time: The database is silently registered to the 1521 port of listening, and static monitoring and forcing the database bound to the 1581 port, so two listening ports are available.
So the reason for this is that when you configure static listening, you use port 1581 instead of the default 1521 port, and you start the default listener. This is not the case if you are using 1521 ports for static listening.
So how can you avoid using non-default listening ports when this happens? You can configure the Local_listener parameter in the database, and refer to the previous blog for details: http://hbxztc.blog.51cto.com/1587495/1890055
Official Document: http://docs.oracle.com/cd/E11882_01/network.112/e41945/listenercfg.htm#NETAG292
This article is from the "DBA fighting!" blog, so be sure to keep this source http://hbxztc.blog.51cto.com/1587495/1931954
Two listeners on a single Oracle database server use simultaneously