Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Simultaneous use of two monitors on an Oracle database server

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

I remember that during the routine inspection, the engineer of the original Oracle factory found that two monitors had been activated on an Oracle database server, which were listening on ports 1521 and 1581 respectively, and both ports were in use, which was regarded as a strange phenomenon at that time and could not understand what the reason was. In recent days, after reading the documentation of the Oracle network configuration, I inadvertently started two monitoring on the virtual machine, which reminded me of the previous problem. What on earth is the reason?

Let's first restore the whole process.

At that time, I was doing the exercise of configuring static monitoring, and a static monitoring was configured in listener.ora:

ORCL= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=tcp) (HOST=192.168.56.2) (PORT=1581)) SID_LIST_ORCL= (SID_LIST= (SID_DESC= (GLOBAL_DBNAME=orcl) (ORACLE_HOME=/u02/app/oracle/product/11.2.4/db1) (SID_NAME=orcl)

Start normally:

Oracle@rhel6 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

At this time, when I typed the lsnrctl start command, something "magical" happened, and another listening began:

Use netstat-nltp to check the port. Both ports are in a listening state:

Now we can test the connection remotely, and even the connection can be successful.

So now the question is, why can two monitors be activated and both can be used? And I do not configure port 1521 snooping in listener.ora, why can I start 1521 snooping?

Let's take a look at the second question, why do you start listening on port 1521? you can find the following words in the official documents:

Because all of the configuration parameters have 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 port 1521 snooping is enabled. I also experimented that even without the listener.ora file, I could start a listening called LISTENER to listen on port 1521.

Explained the problem of monitoring, and then let's look at the first question, why can both monitors be used?

Let's first take a look at dynamic and static monitoring:

Dynamic snooping is that after the database is started, the PMON process registers the service information with the local port. By default, it registers with port 1521 of the local address. The previous monitoring of port 1521 is in line with the default registration mode, so it can be registered successfully, and the database can also provide external services.

At the beginning, the purpose of static monitoring is to replace the work of PMON process registration and directly bind the database service to the monitoring. Even if the database is not started, the service name of the database will still be displayed in the monitoring.

Before knowing this, it is not difficult to understand why two listeners can be used at the same time: the database is registered to port 1521 by default, while static listening forces the database to be bound to port 1581, so both listening ports are accessible.

So the reason for this is that when static snooping is configured, port 1581 instead of the default port 1521 is used, and default snooping is enabled. This will not happen if port 1521 is used for static listening.

So how can this be avoided when using a non-default listening port? You can configure local_listener parameters in the database. Refer to the previous blog: http://hbxztc.blog.51cto.com/1587495/1890055

Official document: http://docs.oracle.com/cd/E11882_01/network.112/e41945/listenercfg.htm#NETAG292

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report