Serverside Configuration   «Prev  Next»

Lesson 5Listener operation
ObjectiveDescribe the interaction between listener.ora and LSNRCTL

Interaction between listener.ora and LSNRCTL

Oracle has provided a series of interactive commands to control the listener process. These commands are invoked from the server by using Oracle's Listener Control utility (LSNRCTL). The Listener Control utility interacts with the listener in the following manner:
  1. The user loads LSNRCTL from ORACLE_HOME/bin.
  2. LSNRCTL reads the listener.ora file from /etc and uses its parameters to configure itself.
  3. LSNRCTL then triggers the start of the listener process.
The next lesson discusses how to use the Oracle Net Assistant.

Listener Control Utility Overview

The Listener Control utility enables you to administer listeners. You can use its commands to perform basic management functions on one or more listeners. Additionally, you can view and change parameter settings. The basic syntax of Listener Control utility commands is as follows:

lsnrctl command [listener_name]

where listener_name is the name of the listener to be administered. If no name is specified, then the default name, LISTENER, is assumed.
You can also issue Listener Control utility commands at the LSNRCTL> program prompt.
To obtain the prompt, enter lsnrctl with no arguments at the operatingcsystem command line. When you run lsnrctl, the program is started. You can then enter the necessary commands from the program prompt. The basic syntax of issuing commands from LSNRCTL> program prompt is as follows:
LSNRCTL> command [listener_name]
Note: You can combine commands in a standard text file, and then run them as a sequence of commands. To execute in batch mode, use the format:
lsnrctl @file_name
You can use either REM or # to identify comments in the batch script; all other lines are considered commands. Any commands that would typically require confirmation do not require confirmation during batch execution.

Oracle Net Connection

For a majority of commands, the Listener Control utility establishes an Oracle Net connection with the listener that is used to transmit the command. To initiate an Oracle Net connection to the listener, the Listener Control utility needs to obtain the protocol addresses for the named listener or a listener named LISTENER. This is done by resolving the listener name with one of the following mechanisms:
  1. listener.ora file in the directory specified by the TNS_ADMIN environment variable
  2. listener.ora file in the $ORACLE_HOME/network/admin directory on UNIX, and the ORACLE_HOME\network\admin directory on Windows operating systems
  3. Naming method, for example, a tnsnames.ora file If the listener name is LISTENER and it cannot be resolved, a protocol address of TCP/IP, port 1521 is assumed.

The Listener Control utility supports several types of commands:
  1. Operational commands, such as START, STOP, and so forth.
  2. Modifier commands, such as SET TRC_LEVEL
  3. Informational commands, such as STATUS and SHOW LOG_FILE
  4. Operational commands, such as EXIT, QUIT, and HELP

Oracle Listener Operation - Exercise

Before moving on to the next lesson, click the Exercise link below to practice creating a listener.ora file.
Oracle Listener Operation - Exercise