Serverside Configuration   «Prev  Next»

Lesson 5Oracle Listener Operation
ObjectiveDescribe how LSNRCTL interacts with listener.ora to control the listener process.

Interaction Between listener.ora and LSNRCTL

Oracle provides a command-line utility called LSNRCTL (Listener Control) to administer the listener process. The utility interacts with the listener using the configuration provided in the listener.ora file.

The interaction follows this sequence:
  1. The user launches lsnrctl from $ORACLE_HOME/bin or from any path with Oracle binaries in $PATH.
  2. LSNRCTL reads the listener.ora file from the directory specified by the TNS_ADMIN environment variable. If TNS_ADMIN is not set, it defaults to $ORACLE_HOME/network/admin on UNIX or ORACLE_HOME\network\admin on Windows.
  3. Based on the configuration, LSNRCTL initiates or interacts with the listener process.
This process enables the listener to accept connections, log events, and register or deregister services as needed.

Listener Control Utility Overview

The Listener Control utility can be used in interactive or batch mode to manage one or more listeners. It supports both command-line execution and prompt-based interaction. Basic Syntax (Direct Execution):

lsnrctl command [listener_name]
    
If no listener name is specified, Oracle assumes LISTENER by default. Interactive Prompt Usage:

lsnrctl
LSNRCTL> command [listener_name]
    
To exit the prompt, use: EXIT or QUIT. Batch Mode Execution: Create a command file and run:

lsnrctl @filename
    

Use `REM` or `#` to comment lines inside the file. All other lines will be interpreted as commands. No confirmation prompts are required in batch mode.


How LSNRCTL Resolves Listener Names

To send commands to a listener, LSNRCTL must first resolve the network address of the listener using one of the following methods:
  1. From listener.ora in the directory specified by the TNS_ADMIN environment variable.
  2. From $ORACLE_HOME/network/admin on UNIX or ORACLE_HOME\network\admin on Windows.
  3. From tnsnames.ora if configured as a naming method.

If the listener name is LISTENER and cannot be resolved using the above methods, Oracle assumes the default address: TCP/IP on port 1521.


LSNRCTL supports several categories of commands:
  • Operational: START, STOP, RELOAD
  • Informational: STATUS, SERVICES, SHOW LOG_FILE
  • Configuration Modifiers: SET, SET TRC_LEVEL
  • Exit and Help: EXIT, QUIT, HELP

Oracle Listener Operation – Exercise

Before moving on to the next lesson, click the link below to practice working with a sample listener.ora configuration:

Oracle Listener Operation – Exercise

SEMrush Software 5 SEMrush Banner 5