|Lesson 5||Listener operation|
|Objective||Describe 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:
- The user loads LSNRCTL from ORACLE_HOME/bin.
- LSNRCTL reads the listener.ora file from /etc and uses its parameters to configure itself.
- 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:
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:
- listener.ora file in the directory specified by the TNS_ADMIN environment variable
- listener.ora file in the $ORACLE_HOME/network/admin directory on UNIX, and the ORACLE_HOME\network\admin directory on Windows
- 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:
- Operational commands, such as START, STOP, and so forth.
- Modifier commands, such as SET TRC_LEVEL
- Informational commands, such as STATUS and SHOW LOG_FILE
- Operational commands, such as EXIT, QUIT, and HELP
Oracle Listener Operation - Exercise