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 operating system 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:
#su - oracle
$. oraenv
$lsnrctl
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. 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 must 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 operating systems and the
%ORACLE_HOME%\network\admin directory on Windows operating systems
·
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.
You can use the SET
command to alter parameter values for a specified listener. You set the name of
the listener you want to administer with the SET
CURRENT_LISTENER command. Parameter values remain in effect until the
listener is shut down. If you want these settings to persist, use the SAVE_CONFIG
command to save changes to the listener.ora. You can use the SHOW
command to display the current value of a configuration setting.
The Listener Control utility can perform operations on a
local or a remote listener. To set up a computer to remotely administer a
listener:
·
Ensure that the Listener Control utility
(lsnrctl) executable is installed.
·
Ensure that the name of the listener you want to
administer can be resolved through a listener.ora file or a naming method.
All commands except START
can be issued when a listener is administered remotely. The Listener Control
utility can only start the listener on the same computer from where the utility
is running. When issuing commands, specify the listener name as an argument.
For example:
LSNRCTL> SERVICES lsnr
If the name is omitted, then listener name set with the SET
CURRENT_LISTENER command is used, or the default name, LISTENER is assumed.
Local listener administration is
secure through local operating system authentication, which restricts listener
administration to the user who started the listener or to the superuser. By
default, no other user can administer the listener. However, you can optionally
configure a password. If the listener control client is installed locally and a
password is configured, a check for password authentication is done. If this
check fails, local operating system administration authentication is attempted.
In contrast, you must configure a
password for remote listener administration, that is, when the listener control
utility is installed on a remote computer. In this case, local operating system
authentication is not used, and the user executing the listener control utility
on the remote computer does not have to be a superuser or the same user who
started the listener process.
Use the Listener Control
utility's CHANGE_PASSWORD
command or Oracle Net Manager to set or modify an encrypted password in the PASSWORDS_listener_name parameter in the
listener.ora file. If the PASSWORDS_listener_name parameter is set to an
unencrypted password, you must manually remove it from the listener.ora file
prior to modifying it. If the unencrypted password is not removed, you will be
unable to successfully set an encrypted password.
If the PASSWORDS_listener_name
parameter is set in the listener.ora file or the CHANGE_PASSWORD command has
been used to create a new, encrypted password, then the Listener Control
utility will require a SET
PASSWORD command prior to any protected command, such as STOP.
Note: If you are administering the listener
remotely over an insecure network and require maximum security, configure the
listener with a secure protocol address that uses the TCP/IP
with SSL protocol. If the listener has multiple protocol addresses, ensure
that the TCP/IP with SSL protocol address is listed first in the listener.ora
file.
CHANGE_PASSWORD: Use the CHANGE_PASSWORD command to establish an encrypted
password or change an encrypted password set with the PASSWORDS_listener_name
parameter in the listener.ora file. If
a password is set, then issue then issue the SET
PASSWORD command prior to this command.
Password: takd01
The command completed
successfully
LSNRCTL> CHANGE_PASSWORD
Old password: takd01
New password: smd01
Reenter new password: smd01
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=tpc)(HOST=sales-server)(PORT=1521)))
Password changed for
LISTENER
The command completed
successfully
LSNRCTL> SAVE_CONFIG
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521)))
Saved LISTENER
configuration parameters.
Listener Parameter
File /oracle/network/admin/listener.ora
Old Parameter File /oracle/network/admin/listener.bak
The command completed
successfully
EXIT: Use the
EXIT command to exit from the Listener Control utility. If a password is set, then the SET
PASSWORD command does not need to be issued prior to this command.
HELP: Use the command HELP to provide a list of all the Listener
Control utility commands or provide syntax help for a particular Listener
Control utility command.If a password is set, then the SET
PASSWORD command does not need to be issued prior to this command.
The following operations
are available
An asterisk (*) denotes a
modifier or extended command:
change_password,exit ,quit,reload
,services,set* ,show*,spawn , start, status ,stop ,trace , version
QUIT: Use the QUIT command to exit the
Listener Control utility and return to the operating system prompt. If a password is set,
then the SET
PASSWORD command does not need to be issued prior to this command. LSNRCTL>
QUIT
RELOAD: Use the RELOAD command to reread the listener.ora file. This
command enables you to add or change statically configured services without
actually stopping the listener. In addition, the database services, instances,
service handlers, and listening endpoints that were dynamically registered with
the listener will be unregistered and subsequently registered again.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521)))
The command completed
successfully
SAVE_CONFIG: Use the SAVE_CONFIG command to compare the current
configuration state of the listener, including trace level, trace file, trace
directory, and logging to the listener.ora file. Any changes are stored in
listener.ora, preserving formatting, comments, and case as much as possible.
Prior to modification of the listener.ora file, a backup of the file, called
listener.bak, is created.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521)))
Saved LISTENER
configuration parameters.
Listener Parameter File /oracle/network/admin/listener.ora
Old Parameter File /oracle/network/admin/listener.bak
The command completed
successfully
SERVICES: Use the SERVICES command to obtain
detailed information about the database services, instances, and service handlers
(dispatchers and dedicated servers) to which the listener forwards client
connection requests.
SET: Use the
SET command to alter the parameter values for the listener. Parameter values
changes remain in effect until the listener is shut down. To make the changes
permanent, use the SAVE_CONFIG
command to save changes to the listener.ora file.
If you are
using the SET commands to alter the configuration of a listener other than the
default LISTENER listener, use the SET
CURRENT_LISTENER command to set the name of the listener you want to
administer.
The following operations
are available with set.
An asterick (*) denotes a
modifier or extended command.
current_listener , displaymode,inbound_connect_timeout,log_file,log_directory
log_status,password ,raw_mode,save_config_on_stop
,startup_waittime ,trc_file
trc_directory, trc_level
SET
CURRENT_LISTENER
Use the SET CURRENT_LISTENER command
to set the name of the listener to administer. Subsequent commands that would
normally require listener_name can be issued without it.
SET
DISPLAYMODE
Use the SET DISPLAYMODE command to
change the format and level of detail for the SERVICES
and STATUS
commands.
normal: Specify to display output in a formatted and
descriptive output. Oracle recommends this mode.
verbose: Specify to display all data received from the
listener in a formatted and descriptive output.
raw: Specify to display all data received from the listener
without any formatting. This output should be used only if recommended by
Oracle Support Services.
Use the SET
INBUND_CONNECT_TIMEOUT command to specify the time, in seconds, for the client
to complete its connect request to the listener after the network connection
had been established. If the listener does not receive the client request in
the time specified, then it terminates the connection. In addition, the listener
logs the IP address of the client and an ORA-12525:TNS: listener has not received client's request in
time allowed error message to the listener.log file.
SET
LOG_DIRECTORY
Use the
command SET LOG_DIRECTORY to set destination directory where the listener log
file is written. By default, the log file is written to the
$ORACLE_HOME/network/log directory on UNIX operating systems and the
%ORACLE_HOME%\network\log directory on Windows.
SET LOG_FILE
Use the command SET LOG_FILE to set
the name for the listener log file. By default, the log file name is
listener.log.
SET
LOG_STATUS
SET PASSWORD
Use the
command SET PASSWORD prior to privileged Listener Control utility commands,
such as SAVE_CONFIG
and STOP.
The password entered should match the one established for the
PASSWORDS_listener_name parameter in the listener.ora file or set by the CHANGE_PASSWORD
command.
Password: password
Use the
command SET SAVE_CONFIG_ON_STOP to specify whether or not changes made to the
parameter values for the listener by the SET
commands are to be saved to the listener.ora file at the time the listener is
stopped with the STOP
command. When changes are saved, the Listener Control utility tries to preserve
formatting, comments, and letter case. Prior to modification of the
listener.ora file, a back up of the file, called listener.bak, is created. To
have all parameters saved right away, use the SAVE_CONFIG
command.
Use the command SET STARTUP_WAITTIME
to specify the amount of time for the listener to wait before responding to a START
command.
SET TRC_DIRECTORY
Use the
command SET TRC_DIRECTORY to set the destination directory where the listener
trace files are written. By default, the trace file are written to the
$ORACLE_HOME/network/trace directory on UNIX operating systems and the
%ORACLE_HOME%\network\trace directory on Windows.
SET TRC_FILE
Use the command SET TRC_FILE to set
the name of the listener trace file. By default, the trace file name is
listener.trc.
SET TRC_LEVEL
- off for no trace output
- user for user trace information
- admin for administration trace information
- support for Oracle Support Services trace information
Use the command SHOW to view the
current parameter values for the listener. All of the SET
parameters, except SET
PASSWORD, have equivalent SHOW parameters.
Use the SPAWN command to start a program stored on the computer on
which the listener is running, and which is listed with an alias in the
listener.ora file.
alias: The alias of the program to be spawned off is
specified by a listener.ora file entry, similar to the following:
alias = (PROGRAM=(NAME=)(ARGS=)(ENVS=))
nstest =
(PROGRAM=(NAME=nstest)(ARGS=test1)(ENVS='ORACLE_HOME=/usr/oracle'))
Use the command STATUS to display
basic status information about a listener, including a summary of listener
configuration settings, listening protocol addresses, and a summary of services
registered with the listener.
level: Specify one of the
following trace levels:
- off for no trace output
- user for user trace information
- admin for administration trace information
- support for Oracle Support Services trace information
No comments:
Post a Comment
Share your knowledge it really improves, don't show off...