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

What is an Oracle listener

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

Share

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

This article introduces to you what is an Oracle listener, the content is very detailed, interested friends can refer to, hope to be helpful to you.

I've always wanted to write about the monitor.

Oracle listener listener is an important database server component, which plays an important role in the whole Oracle architecture.

Listener Lisener function

Judging from the current version of Oracle, Listener is mainly responsible for the following functions:

1. Listen for client requests. The listener runs on the database server and is associated with multiple Oracle instances. It is a special process process. The corresponding running process can be seen in the service project of windows or in the list of running processes of Linux. Windows is called lsnrctl on the platform called TNSLSNR,Linux/Unix. The listener waits on the server setting port (default: 1521) to listen for client requests.

2. Assign Server Process to the client request. The listener is only responsible for answering the request and then transferring the request to the Oracle Server Process. In Oracle service mode, client processes are not allowed to directly manipulate database instances and data, but through a service process Server Process (also known as shadow process) as a proxy. After the listener receives the request, it asks the operating system (or Dispatcher component) to fork (or assign) a Server Process to connect to the client.

3. Register the instance service. In essence, listener is a bridge between instances and client processes. The connection between Listener and instance is achieved through the registration process. The registration process is for the instance to tell the listener that its database instance name instance_name and service name service_names. The listener registers such information to find the correct service instance name according to the listener registration information for the client request. In the current version of Oracle, dynamic registration and static registration are provided.

4. Error transfer failover. Failover is an important aspect of RAC fault tolerance, which is a function that automatically transfers requests to other available instances when a database instance crashes. Can provide a large degree of availability (Availability) functionality. In the process, it is a function of listener to find that the instance has crashed and transfer the request to another instance.

5. Load balancing measurement. In the RAC architecture, Oracle implements load balancing. When a customer request arrives, Oracle will, based on the load of all instances in the current RAC cluster environment, avoid the instances with higher load and transfer the request to the instance with lower load for processing. In earlier versions of RAC, load was measured based on the number of connections currently maintained by the listener, rather than looking at the load of multiple instances in real time. Communication between listeners in the RAC environment.

The following section gives a brief introduction to the listener from several aspects.

Listener operation

Listeners can be operated directly on both Windows and Linux/Unix platforms. Let's take the operation of the Windows platform as an example, and other platforms are similar.

In the command line window (CMD), type lsnrctl to enter the listener control window.

C:\ Documents and Settings\ Administrator > lsnrctl

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0-Production on 26-December-2010 21:5

3:04

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Welcome to LSNRCTL. Type "help" for information.

LSNRCTL >

You can view the supported listener operations by entering the command help. Here are just a few commonly used ones.

1. View the status of the current listener

Type status to view the status of the current listener and correspond to operation log information and service registration information. As follows:

LSNRCTL > status

/ / name and information of the connection listener: hostname + listener port number

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0-Production / / Listener version information, which is important in the case of multiple instances on one machine! Because the version corresponds to backward compatibility

Start date 26-December-2010 19:38:03 / / start-up time

Uptime 0 days, 2 hours, 23 minutes, 51 seconds.

Trace level off / / debug information, you can set trace for listeners

Security ON: Local OS Authentication / / indicates that the operation permissions for starting and closing listeners are verified by OS. This means that password items can be set for listeners, which is also an important aspect of Oracle security configuration.

SNMP OFF / / SNMP protocol enabled

Parameters used in the listener parameter file D:\ oracle\ network\ admin\ listener.ora / /

Listener log file D:\ oracle\ network\ log\ listener.log / / Operation log location

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=www-0e6111dff74) (PORT=1521))

Service summary.. / / list of services that are currently registered in the listener

The service "PLSExtProc" contains 1 routine.

Routine "PLSExtProc", status UNKNOWN, contains 1 handler for this service.

The service "orcl" contains 1 routine.

Routine "orcl", status READY, contains 1 handler for this service.

The service "orclXDB" contains 1 routine.

Routine "orcl", status READY, contains 1 handler for this service.

The service "orcl_XPT" contains 1 routine.

Routine "orcl", status READY, contains 1 handler for this service.

Command executed successfully

The results have been explained to a certain extent by the scarlet letter above. Among them, need to pay extra attention to the following.

Parameters used in the listener parameter file D:\ oracle\ network\ admin\ listener.ora / /

Listeners start according to parameter files, of course, listeners can also be started without parameter files, and then listeners operate according to the default behavior. This parameter specifies the location of the listener parameter file, listener.ora. This file is a text type parameter file that describes the listener port, host name, and static registration information. Listener.ora is dynamically configured during the process of building listeners after the establishment of the database instance.

Listener log file D:\ oracle\ network\ log\ listener.log / / Operation log location

The listener log is an information base that records and describes the work and errors of the listener. By carefully studying the contents of the log, we can help us find problems with current listeners, solve connection failures, and gain an in-depth understanding of how listeners work.

The service "orcl" contains 1 routine.

Routine "orcl", status READY, contains 1 handler for this service.

As mentioned above, listeners have the ability to register through the status command (the same effect as the services command). You can see what services are currently registered to check the failure of the connection service, which is a common tool.

2. Turn the listener on / off

The behavior of the listener is controlled by the parameter file, and we sometimes need to adjust the parameters of the listener. The method of adjusting listening parameters can be done through the GUI interface provided by Oracle, or by manually modifying listener.ora.

Because the parameter file listener.ora is a text file. Oracle does not support hot loading for text-type parameter files in most cases. This is true for both Pfile and listener.ora.

To use the interface GUI, you use Net Configuration Assistant to configure. After the configuration is complete, the configuration program automatically restarts the listener program to load the modified parameter file. If you modify the listener.ora manually, you must manually shut down and start the listener.

LSNRCTL > stop

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

Command executed successfully

LSNRCTL > start

Start tnslsnr: please wait a moment.

TNSLSNR for 32-bit Windows: Version 10.2.0.1.0-Production

The system parameter file is D:\ oracle\ network\ admin\ listener.ora

Write log information to D:\ oracle\ network\ log\ listener.log

Monitoring: (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=www-0e6111dff74) (PORT=1521)

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=www-0e6111dff74) (PORT=1521))

))

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0-Production

Launch date 26-December-2010 22:32:34

Normal running time 0 days, 0 hours, 0 minutes, 2 seconds

Trace level off

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file D:\ oracle\ network\ admin\ listener.ora

Listener log file D:\ oracle\ network\ log\ listener.log

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=www-0e6111dff74) (PORT=1521))

Service summary..

The service "PLSExtProc" contains 1 routine.

Routine "PLSExtProc", status UNKNOWN, contains 1 handler for this service.

Command executed successfully

Here is one more sentence about the parameter configuration of the listener. Using GUI can satisfy most situations and avoid listener failures caused by spelling errors (listeners do not check whether the configuration item is correct or not). However, in some complex situations, such as binding multiple IP to a machine, or the complex functional configuration of RAC, there is still a preference for the method of writing listener.ora by hand.

In addition, the lsnrctl prompt line provides the reload command to reload the file and SID information when listener starts. But the author still likes the combination of stop+start.

If it is under the windows platform, the startup and shutdown listener can also be operated in the list of system service items, and the effect is the same.

Now that you've learned about the listener tools, let's take a look at how listeners work next time.

On what is the Oracle listener to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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

Wechat

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

12
Report