1 Listener Control Utility
This chapter describes the Listener Control Utility commands and syntax. The terms SQL*Net and Net Services are used interchangeably throughout Oracle documentation.
- Listener Control Utility Overview
To perform basic management functions on one or more listeners, you can use the Listener Control utility commands. You can also use these commands to view and change parameter settings. - SET and SHOW Listener Control Utility Commands
TheSET
andSHOW
commands enable you to alter and view listener configuration parameters. - Understanding Distributed Operations
Listener Control utility can perform operations on local or remote listeners. - Understanding Oracle Net Listener Security
Authentication for listener administration depends on whether you access the listener locally or remotely. - Listener Control Utility Commands
Use Listener Control Utility commands to manage and configure your listeners.
1.1 Listener Control Utility Overview
To perform basic management functions on one or more listeners, you can use the Listener Control utility commands. You can also use these commands to view and change parameter settings.
The Listener Control utility enables you to administer listeners. The syntax of Listener Control utility commands is as follows:
lsnrctl command listener_name
In the preceding command, listener_name
is the name of the listener that you want to administer. If you do not specify a specific listener in the command string, then the command is directed to the default listener name, LISTENER
.
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 commands from the program prompt. The basic syntax of issuing commands from LSNRCTL>
program prompt is:
lsnrctl LSNRCTL> command listener_name
You can combine commands in a standard text file and then run them as a sequence of commands. To run in batch mode, use this format:
lsnrctl @file_name
To identify comments in the batch script, you can use either REM
or #
. All other lines are considered commands. Commands that require confirmation do not require confirmation during batch processing.
For most commands, Listener Control utility establishes an Oracle Net connection with the listener that transmits the command. To initiate an Oracle Net connection to the listener, 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:
-
listener.ora
file in the directory specified by theTNS_ADMIN
environment variable. -
listener.ora
file in theORACLE_HOME/network/admin
directory. -
Naming method; for example, a
tnsnames.ora
file.
If none of the preceding mechanisms resolve the listener name, then Listener Control utility uses the default listener name LISTENER
, resolves the host name IP address, and uses port 1521.
The Listener Control utility supports the following types of commands:
-
Operational commands, such as
START
, andSTOP
. -
Modifier commands, such as
SET TRC_LEVEL
. -
Informational commands, such as
STATUS
, andSHOW LOG_FILE
.
Parent topic: Listener Control Utility
1.2 SET and SHOW Listener Control Utility Commands
The SET
and SHOW
commands enable you to alter and view listener configuration parameters.
Use the SET
command to alter parameter values for a specified listener. You set the name of the listener to administer using the SET CURRENT_LISTENER
command. Parameter values remain in effect until the listener is shut down. If you want these settings to persist, then use the SAVE_CONFIG
command to save changes to the listener.ora
file.
You can use the SHOW
command to display the current value of a configuration setting.
Parent topic: Listener Control Utility
1.3 Understanding Distributed Operations
Listener Control utility can perform operations on local or remote listeners.
This example explains how to configure listeners for remote administration.
Set Up a Computer to Remotely Administer a Listener
Ensure that the Listener Control utility (lsnrctl
) executable is installed in the ORACLE_HOME/bin
directory. You can resolve the name of the listener that you want to administer either through a listener.ora
file, or by a naming method.
When you administer a listener remotely, you can issue all of the commands except START
. However, Listener Control utility only starts the listener on the same computer from which the utility runs.
When issuing commands, specify the listener name as an argument. If you omit the listener name in the command, then the listener name set with the command SET CURRENT_LISTENER
is used. If you do not set the listener name with that command, then the command is directed to the default listener name, LISTENER
.
Example 1-1 Issuing Commands Using the Listener Control Utility
LSNRCTL> SERVICES lsnr
Parent topic: Listener Control Utility
1.4 Understanding Oracle Net Listener Security
Authentication for listener administration depends on whether you access the listener locally or remotely.
Local listener administration security is administered using local operating system authentication. Local authentication restricts listener administration to the user account that started the listener or to the super user. By default, remote listener administration is disabled.
Oracle recommends that you perform listener administration in the default mode and that you access the system remotely using a remote login. When you administer the listener remotely, use either Oracle Enterprise Manager Cloud Control or Secure Shell (SSH) to access the remote host.
Parent topic: Listener Control Utility
1.5 Listener Control Utility Commands
Use Listener Control Utility commands to manage and configure your listeners.
- EXIT
Use the Listener Control utility commandEXIT
to exit from the Listener Control utility and return to the operating system prompt. - HELP
Use the Listener Control utility commandHELP
to list the Listener Control utility commands and to obtain syntax help for particular Listener Control utility commands. - QUIT
Use the Listener Control utility commandQUIT
to exit from the Listener Control utility and return to the operating system prompt. - RELOAD
Use the Listener Control utility commandRELOAD
to reload thelistener.ora
file so that you can add or change statically configured services without stopping the listener. - SAVE_CONFIG
Use the Listener Control utility commandSAVE_CONFIG
to save the current configuration state of the listener to thelistener.ora
file. - SERVICES
Use the Listener Control utility commandSERVICES
to return details about database services, instances, and service handlers to which listeners forward client connection requests. - SET
Use the Listener Control utility commandSET
to alter listener parameter values. - SET CURRENT_LISTENER
Use the Listener Control utility commandSET CURRENT_LISTENER
to set the name of the listener to administer. - SET DISPLAYMODE
Use the Listener Control utility commandSET DISPLAYMODE
to change the format and detail level for theSERVICES
andSTATUS
commands. - SET INBOUND_CONNECT_TIMEOUT
Use the Listener Control utility commandSET INBOUND_CONNECT_TIMEOUT
to specify the duration in which clients must complete connection requests to listeners after establishing network connections. - SET LOG_DIRECTORY
Use the Listener Control utility commandSET LOG_DIRECTORY
to set the destination directory to which the listener log file is written. - SET LOG_FILE
Use the Listener Control utility commandSET LOG_FILE
to set the listener log file name. - SET LOG_STATUS
Use the Listener Control utility commandSET LOG_STATUS
to turn listener logging on or off. - SET SAVE_CONFIG_ON_STOP
Use the Listener Control utility commandSET SAVE_CONFIG_ON_STOP
to specify whether listener parameter value changes that you make with theSET
command are saved to thelistener.ora
file when you stop the listener with theSTOP
command. - SET TRC_DIRECTORY
Use the Listener Control utility commandSET TRC_DIRECTORY
to set the destination directory into which Oracle writes listener trace files. - SET TRC_FILE
Use the Listener Control utility commandSET TRC_FILE
to set the names of listener trace files. - SET TRC_LEVEL
Use the Listener Control utility commandSET TRC_LEVEL
to set a specific listener tracing level. - SHOW
Use the Listener Control utility commandSHOW
to list current listener parameter values. - SPAWN
Use the Listener Control utility commandSPAWN
to start a program that is stored on the computer on which the listener is running and that is listed with an alias in thelistener.ora
file. - START
Use the Listener Control utility commandSTART
to start a named listener. - STATUS
Use the Listener Control utility commandSTATUS
to show listener status information. - STOP
Use the Listener Control utility commandSTOP
to stop the named listener. - TRACE
Use the Listener Control utility commandTRACE
to set listener tracing. - VERSION
Use the Listener Control utility commandVERSION
to show the current version of Listener Control utility.
Parent topic: Listener Control Utility
1.5.1 EXIT
Use the Listener Control utility command EXIT
to exit from the Listener Control utility and return to the operating system prompt.
Purpose
To exit from the Listener Control utility and return to the operating system prompt.
Prerequisites
None
Syntax
From the Listener Control utility:
LSNRCTL> EXIT
Arguments
None
Usage Notes
This command is identical to the QUIT
command.
Example
LSNRCTL> EXIT
Parent topic: Listener Control Utility Commands
1.5.2 HELP
Use the Listener Control utility command HELP
to list the Listener Control utility commands and to obtain syntax help for particular Listener Control utility commands.
Purpose
To provide a list of the Listener Control utility commands or to provide syntax help for a particular Listener Control utility command.
Prerequisites
None
Syntax
From the operating system:
lsnrctl HELP command
From the Listener Control utility:
LSNRCTL> HELP command
Arguments
command
: The Listener Control utility command. Commands are shown in the following example output.
When you enter a command as an argument to HELP
, the Listener Control utility displays information about how to use the command. When you enter HELP
without an argument, the Listener Control utility lists all the commands.
Example
LSNRCTL> HELP
The following operations are available
An asterisk (*) denotes a modifier or extended command:
exit
quit
reload
services
set*
show*
spawn
start
status
stop
trace
version
Parent topic: Listener Control Utility Commands
1.5.3 QUIT
Use the Listener Control utility command QUIT
to exit from the Listener Control utility and return to the operating system prompt.
Purpose
To exit from the Listener Control utility and return to the operating system prompt.
Prerequisites
None
Syntax
From the Listener Control utility:
LSNRCTL> QUIT
Arguments
None
Usage Notes
This command is identical to the EXIT
command.
Example
LSNRCTL> QUIT
Parent topic: Listener Control Utility Commands
1.5.4 RELOAD
Use the Listener Control utility command RELOAD
to reload the listener.ora
file so that you can add or change statically configured services without stopping the listener.
Purpose
To reload the listener.ora
file. This command enables you to add or change statically configured services without actually stopping the listener.
When you run this command, the database services, instances, service handlers, and listening endpoints previously registered dynamically with the listener are unregistered, and subsequently registered again.
To obtain a lightweight reload without dropping registration, use the option –with_ha
. Using this option ensures that registered services remain available to clients during reload.
Prerequisites
None
Syntax
From the operating system:
lsnrctl RELOAD [-with_ha] listener_name
From the Listener Control utility:
LSNRCTL> RELOAD [-with_ha] listener_name
Arguments
listener_name
: The listener name, if the default name of LISTENER
is not used.
-with_ha
: command option used with RELOAD
that indicates that the reload of listener.ora
is completed without dropping existing registrations.
Example
LSNRCTL> RELOAD
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521)))
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.5 SAVE_CONFIG
Use the Listener Control utility command SAVE_CONFIG
to save the current configuration state of the listener to the listener.ora
file.
Purpose
To save 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. Before modification of the listener.ora
file, a backup of the file, called listener.bak
, is created.
Syntax
From the operating system:
lsnrctl SAVE_CONFIG listener_name
From the Listener Control utility:
LSNRCTL> SAVE_CONFIG listener_name
Arguments
listener_name
: The listener name, if the default name of LISTENER
is not used.
Usage Notes
This command enables you to save all run-time configuration changes to the listener.ora
file.
Example
LSNRCTL> SAVE_CONFIG listener
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
Parent topic: Listener Control Utility Commands
1.5.6 SERVICES
Use the Listener Control utility command SERVICES
to return details about database services, instances, and service handlers to which listeners forward client connection requests.
Purpose
To obtain detailed information about the database services, instances, and service handlers (dispatchers and dedicated servers) to which the listener forwards client connection requests.
Prerequisites
None
Syntax
Arguments
From the operating system:
lsnrctl SERVICES listener_name
From the Listener Control utility:
LSNRCTL> SERVICES listener_name
listener_name
: The listener name, if the default name of LISTENER
is not used.
Usage Notes
The SET DISPLAYMODE
command changes the format and the detail level of the output.
See Also:
Oracle Database Net
Services Administrator's Guide for a complete description of SERVICES
output
Example
This example shows SERVICES
output in the default display mode. The output shows the following:
-
An instance named
sales
belonging to two services,sales1.us.example.com
andsales2.us.example.com
, with a total of three service handlers. -
Service
sales1.us.example.com
is handled by one dispatcher only. -
Service
sales2.us.example.com
is handled by one dispatcher and one dedicated server, as specified in the following.
LSNRCTL> SERVICES
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=net)))
Services Summary...
Service "sales1.us.example.com" has 1 instance(s).
Instance "sales", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:10000 state:ready
DISPATCHER <machine: sales-server, pid: 5696>
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=53411))
Service "sales2.us.example.com" has 1 instance(s).
Instance "sales", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
"D001" established:0 refused:0 current:0 max:10000 state:ready
DISPATCHER <machine: sales-server, pid: 5698>
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=52618))
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.7 SET
Use the Listener Control utility command SET
to alter listener parameter values.
Purpose
To alter the parameter values for the listener. Parameter value changes remain in effect until the listener is shut down. To make changes permanent, use the SAVE_CONFIG command to save changes to the listener.ora
file.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SET parameter
From the Listener Control utility:
LSNRCTL> SET parameter
Arguments
parameter
: A SET
parameter to modify its configuration setting. Parameters are shown in the example output.
When you enter SET
without an argument, the Listener Control utility lists all of the parameters.
Usage Notes
If you are using the SET
commands to alter the configuration of a listener other than the default LISTENER
listener, then use the SET CURRENT_LISTENER
command to set the name of the listener to administer.
Example
LSNRCTL> SET
The following operations are available with set.
An asterisk (*) denotes a modifier or extended command.
current_listener
displaymode
inbound_connect_timeout
log_file
log_directory
log_status
rawmode
save_config_on_stop
trc_file
trc_directory
trc_level
Parent topic: Listener Control Utility Commands
1.5.8 SET CURRENT_LISTENER
Use the Listener Control utility command SET CURRENT_LISTENER
to set the name of the listener to administer.
Purpose
To set the name of the listener that you want to administer. After you set the listener name with this command, you can issue subsequent commands that normally require listener_name
without specifying the listener.
Syntax
From the Listener Control utility:
LSNRCTL> SET CURRENT_LISTENER listener_name
Arguments
listener_name
: The listener name, if you are not using the default name LISTENER
.
Usage Notes
When you specify a listener name using SET CURRENT_LISTENER
, the Listener Control utility commands act on the listener name that you specify with this command. You do not have to continue to specify the name of the listener.
Example
LSNRCTL> SET CURRENT_LISTENER lsnr
Current Listener is lsnr
Parent topic: Listener Control Utility Commands
1.5.9 SET DISPLAYMODE
Use the Listener Control utility command SET DISPLAYMODE
to change the format and detail level for the SERVICES
and STATUS
commands.
Purpose
To change the format and level of detail for the SERVICES
and STATUS
commands.
Syntax
From the Listener Control utility:
LSNRCTL> SET DISPLAYMODE {compat | normal | verbose | raw}
Arguments
Specify one of the following modes:
compat
: Output that is compatible with earlier releases of the listener.
normal
: Output that is formatted and descriptive. Oracle recommends this mode.
verbose
: All data received from the listener in a formatted and descriptive output.
raw
: All data received from the listener without any formatting. This argument should be used only if recommended by Oracle Support Services.
Example
LSNRCTL> SET DISPLAYMODE normal
Service display mode is NORMAL
Parent topic: Listener Control Utility Commands
1.5.10 SET INBOUND_CONNECT_TIMEOUT
Use the Listener Control utility command SET INBOUND_CONNECT_TIMEOUT
to specify the duration in which clients must complete connection requests to listeners after establishing network connections.
Purpose
To specify the time, in seconds, for the client to complete its connect request to the listener after establishing the network connection.
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.
See Also:
Oracle Database Net Services Administrator's Guide for additional information about specifying the time out for client connections
Syntax
From the Listener Control utility:
LSNRCTL> SET INBOUND_CONNECT_TIMEOUT time
Arguments
time
: The duration of time in seconds. Default setting is 60 seconds.
Example
LSNRCTL> SET INBOUND_CONNECT_TIMEOUT 2
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
LISTENER parameter "inbound_connect_timeout" set to 2
The command completed successfully.
Parent topic: Listener Control Utility Commands
1.5.11 SET LOG_DIRECTORY
Use the Listener Control utility command SET LOG_DIRECTORY
to set the destination directory to which the listener log file is written.
Purpose
To set the destination directory to which the listener log file is written. By default, the log file is written to the ORACLE_HOME/network/log
directory.
Note:
This command works only if Automatic Diagnostic Repository (ADR) is disabled. The default is for ADR to be enabled and to use the log directory ORACLE_HOME/log/diag/product_type
.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SET LOG_DIRECTORY directory
From the Listener Control utility:
LSNRCTL> SET LOG_DIRECTORY directory
Arguments
directory
: The directory path of the listener log file.
Example
LSNRCTL> SET LOG_DIRECTORY /usr/oracle/admin
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
LISTENER parameter "log_directory" set to /usr/oracle/admin
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.12 SET LOG_FILE
Use the Listener Control utility command SET LOG_FILE
to set the listener log file name.
Purpose
To set the name for the listener log file. By default, the log file name is listener.log
.
Note:
This command works only if Automatic Diagnostic Repository (ADR) is disabled. The default is for ADR to be enabled and to use the log directory ORACLE_HOME/log/diag/product_type
.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SET LOG_FILE file_name
From the Listener Control utility:
LSNRCTL> SET LOG_FILE file_name
Arguments
file_name
: The file name of the listener log.
Example
LSNRCTL> SET LOG_FILE list.log
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
LISTENER parameter "log_file" set to list.log
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.13 SET LOG_STATUS
Use the Listener Control utility command SET LOG_STATUS
to turn listener logging on or off.
Purpose
To turn listener logging on or off.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SET LOG_STATUS {on | off}
From the Listener Control utility:
LSNRCTL> SET LOG_STATUS {on | off}
Arguments
on
: To turn logging on.
off
: To turn logging off.
Example
LSNRCTL> SET LOG_STATUS on
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
LISTENER parameter "log_status" set to ON
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.14 SET SAVE_CONFIG_ON_STOP
Use the Listener Control utility command SET SAVE_CONFIG_ON_STOP
to specify whether listener parameter value changes that you make with the SET
command are saved to the listener.ora
file when you stop the listener with the STOP
command.
Purpose
To specify whether changes made to parameter values for the listener by the SET
command are saved to the listener.ora
file when the listener is stopped with the STOP
command.
When you save changes, the Listener Control utility tries to preserve formatting, comments, and letter case. Before the command modifies the listener.ora
file, it creates a backup of the file called listener.bak
.
To have all parameters saved immediately, use the SAVE_CONFIG
command.
Syntax
From the operating system:
lsnrctl SET SAVE_CONFIG_ON_STOP {on | off}
From the Listener Control utility:
LSNRCTL> SET SAVE_CONFIG_ON_STOP {on | off}
Arguments
on
: To save configuration to listener.ora
.
off
: To not save configuration to listener.ora
.
Example
LSNRCTL> SET SAVE_CONFIG_ON_STOP on
LISTENER parameter "save_config_on_stop" set to ON
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.15 SET TRC_DIRECTORY
Use the Listener Control utility command SET TRC_DIRECTORY
to set the destination directory into which Oracle writes listener trace files.
Purpose
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.
Note:
This command works only if Automatic Diagnostic Repository (ADR) is disabled. The default is for ADR to be enabled and to use the log directory ORACLE_HOME/log/diag/product_type
.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SET TRC_DIRECTORY directory
From the Listener Control utility:
LSNRCTL> SET TRC_DIRECTORY directory
Arguments
directory
: The directory path of the listener trace files.
Example
LSNRCTL> SET TRC_DIRECTORY /usr/oracle/admin
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
LISTENER parameter "trc_directory" set to /usr/oracle/admin
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.16 SET TRC_FILE
Use the Listener Control utility command SET TRC_FILE
to set the names of listener trace files.
Purpose
To set the name of the listener trace file. By default, the trace file name is listener.trc
.
Note:
This command works only if Automatic Diagnostic Repository (ADR) is disabled. The default is for ADR to be enabled and to use the log directory ORACLE_HOME/log/diag/product_type
.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SET TRC_FILE file_name
From the Listener Control utility:
LSNRCTL> SET TRC_FILE file_name
Arguments
file_name
: The file name of the listener trace.
Example
LSNRCTL> SET TRC_FILE list.trc
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
LISTENER parameter "trc_file" set to list.trc
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.17 SET TRC_LEVEL
Use the Listener Control utility command SET TRC_LEVEL
to set a specific listener tracing level.
Purpose
To set a specific level of tracing for listeners.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SET TRC_LEVEL level
From the Listener Control utility:
LSNRCTL> SET TRC_LEVEL level
Arguments
level
: 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
Usage Notes
This command has the same functionality as the TRACE
command.
Example
LSNRCTL> SET TRC_LEVEL admin
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
LISTENER parameter "trc_level" set to admin
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.18 SHOW
Use the Listener Control utility command SHOW
to list current listener parameter values.
Purpose
To view the current parameter values for the listener.
All of the SET
parameters have equivalent SHOW
parameters.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SHOW parameter
From the Listener Control utility:
LSNRCTL> SHOW parameter
Arguments
parameter
: A parameter whose settings you want to review. Parameters are shown in the example output.
When you enter SHOW
without an argument, the Listener Control utility lists all the parameters.
Example
LSNRCTL> SHOW
The following properties are available with SHOW:
An asterisk (*) denotes a modifier or extended command:
current_listener
displaymode
inbound_connect_timeout
log_file
log_directory
log_status
rawmode
save_config_on_stop
trc_file
trc_directory
trc_level
Parent topic: Listener Control Utility Commands
1.5.19 SPAWN
Use the Listener Control utility command SPAWN
to start a program that is stored on the computer on which the listener is running and that is listed with an alias in the listener.ora
file.
Purpose
To start a program stored on the computer on which the listener is running and that is listed with an alias in the listener.ora
file.
Prerequisites
None
Syntax
From the operating system:
lsnrctl SPAWN listener_name alias (arguments='arg1,arg2,...')
From the Listener Control utility:
LSNRCTL> SPAWN listener_name alias (arguments='arg1,arg2,...')
Arguments
listener_name
: The listener name, if the default name of LISTENER
is not used.
alias
: The alias of the program to be spawned is specified by a listener.ora
file entry that is similar to the following:
alias = (PROGRAM=(NAME=)(ARGS=)(ENVS=))
For example:
nstest = (PROGRAM=(NAME=nstest)(ARGS=test1)(ENVS='ORACLE_HOME=/usr/oracle'))
Example
The nstest
program, shown in the preceding section, can then be spawned using the following command:
lsnrctl SPAWN listener_name nstest
Parent topic: Listener Control Utility Commands
1.5.20 START
Use the Listener Control utility command START
to start a named listener.
Purpose
To start the named listener.
Prerequisites
The listener must not be running.
Syntax
From the operating system:
lsnrctl START listener_name
From the Listener Control utility:
LSNRCTL> START listener_name
Note:
On Microsoft Windows, if the database was installed with the Oracle Home User, then the utility can prompt for a password. The password is the operating system password for the Oracle Home User. The prompt is displayed only if the listener service does not exist and if it needs to be created as part of starting the listener.
Arguments
listener_name
: The listener name if the default name of LISTENER
is not used.
Usage Notes
To start a listener that you configured in the listener.ora
file whose name does not contain the string LISTENER
.
For example, if the listener name is tcp_lsnr
, enter:
lsnrctl START tcp_lsnr
From the Listener Control utility:
LSNRCTL> START tcp_lsnr
Example
LSNRCTL> START
Starting /private/sales_group/sales/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 21.1.0.0.0
System parameter file is $ORACLE_HOME/network/admin/listener.ora
Log messages written to $ORACLE_BASE/diag/tnslsnr/node_name/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 21.1.0.0.0
Start Date 21-JAN-2020 21:50:49
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authetication
SNMP OFF
Listener Parameter File $ORACLE_HOME/network/admin/listener.ora
Listener Log File $ORACLE_BASE/diag/tnslsnr/node_name/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)))
The listener supports no services
The command completed successfully
See Also:
Oracle Database Administrator’s Reference for Microsoft Windows for information about the Oracle Home User
Parent topic: Listener Control Utility Commands
1.5.21 STATUS
Use the Listener Control utility command STATUS
to show listener status information.
Purpose
To display basic status information about a listener, including a summary of listener configuration settings, listening protocol addresses, and a summary of services that are registered with the listener.
Note:
You can also obtain the status of the listener through the Oracle Enterprise Manager Cloud Control console.
Prerequisites
None
Syntax
From the operating system:
lsnrctl STATUS listener_name
From the Listener Control utility:
LSNRCTL> STATUS listener_name
Arguments
listener_name
: The listener name, if the default name of LISTENER
is not used.
Usage Notes
The SET DISPLAYMODE
command changes the format and the level of output detail.
See Also:
Oracle Database Net
Services Administrator's Guide for a complete description of STATUS
output
Example
The following example shows STATUS
output in the default display mode. The output contains:
-
Listener configuration settings
-
Listening endpoints summary
-
Services summary, which is an abbreviated version of the
SERVICES
command output
LSNRCTL> STATUS
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=net)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 21.1.0.0.0 -
Production
Start Date 12-JAN-2020 12:02:00
Uptime 0 days 0 hr. 5 min. 29 sec
Trace Level support
Security OFF
SNMP OFF
Listener Parameter File /oracle/network/admin/listener.ora
Listener Log File /oracle/network/log/listener.log
Listener Trace File /oracle/network/trace/listener.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=net)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=sales-server)(PORT=2484)))
Services Summary...
Service "sales1.us.example.com" has 1 instance(s).
Instance "sales", status READY, has 1 handler(s) for this service...
Service "sales2.us.example.com" has 1 instance(s).
Instance "sales", status READY, has 2 handler(s) for this service...
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.22 STOP
Use the Listener Control utility command STOP
to stop the named listener.
Purpose
To stop the named listener.
Prerequisites
The named listener must be running.
Syntax
From the operating system:
lsnrctl STOP listener_name
From the Listener Control utility:
LSNRCTL> STOP listener_name
Arguments
listener_name
: The listener name, if the default name of LISTENER
is not used.
Example
LSNRCTL> STOP
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.23 TRACE
Use the Listener Control utility command TRACE
to set listener tracing.
Purpose
To set tracing for the listener.
Syntax
From the operating system:
lsnrctl trace level listener_name
From the Listener Control utility:
LSNRCTL> trace level listener_name
Arguments
level
: 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
listener_name
: Specify the listener name, if the default name of LISTENER
is not used.
Usage Notes
This command has the same functionality as the SET TRC_LEVEL
command.
Example
LSNRCTL> TRACE ADMIN lsnr
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
Opened trace file: /oracle/network/trace/listener.trc
The command completed successfully
Parent topic: Listener Control Utility Commands
1.5.24 VERSION
Use the Listener Control utility command VERSION
to show the current version of Listener Control utility.
Purpose
To display the current version of Listener Control utility.
Prerequisites
None
Syntax
From the operating system:
lsnrctl VERSION listener_name
From the Listener Control utility:
LSNRCTL> VERSION listener_name
Arguments
listener_name
: The listener name, if the default name of LISTENER
is not used.
Example
LSNRCTL> version listener
Connecting to ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=1521))
TNSLSNR for Linux: Version 21.1.0.0.0
TNS for Linux: Version 21.1.0.0.0
Oracle Bequeath NT Protocol Adapter for Linux: Version 21.1.0.0.0
Unix Domain Socket IPC NT Protocol Adaptor for Linux: Version 21.1.0.0.0
TCP/IP NT Protocol Adapter for Linux: Version 21.1.0.0.0
The command completed successfully
Parent topic: Listener Control Utility Commands