Oracle lsnrctl commands

The Oracle Listener Control (lsnrctl) is an SQL*Net utility used for controlling database listeners. A listener is required for allowing remote (not local) clients to connect to the Oracle database via the network. This utility cannot create or configure listeners, but provides commands to control listener functions such as starting and stopping listeners, reporting the status of listeners, changing parameter listener settings, etc.

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> command 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:

$ lsnrctl
LSNRCTL> command [listener_name]

The Listener Control utility supports several types of commands:

  • Operational commands, such as START and STOP
  • Modifier commands, such as SET TRC_LEVEL
  • Informational commands, such as STATUS and SHOW LOG_FILE
  • Operational commands, such as EXIT, RELOAD, and HELP

Start / Stop the listener

via command line:

$ lsnrctl start [listener_name]
$ lsnrctl stop [listener_name]

via the Listener control utility:

$ lsnrctl
LSNRCTL> start [listener_name]
LSNRCTL> stop [listener_name]

Listener Status

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.

from the operating system:

$ lsnrctl STATUS [listener_name]

via the Listener Control utility:

$ lsnrctl
LSNRCTL> status [listener_name]

Reload configuration

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.

command-line syntax:

$ lsnrctl reload [listener_name]

via Listener Control utility:

$ lsnrctl
LSNRCTL> RELOAD [listener_name]

Listener 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.

command-line syntax:

$ lsnrctl services [listener_name]

via Listener Control utility:

$ lsnrctl
LSNRCTL> SERVICES [listener_name]

Command Summary

Command line

$ lsnrctl start [listener_name]
$ lsnrctl stop [listener_name]
$ lsnrctl status [listener_name]
$ lsnrctl reload [listener_name]
$ lsnrctl services [listener_name]

Listener Control Utility:

LSNRCTL> start [listener_name]
LSNRCTL> stop [listener_name]
LSNRCTL> status [listener_name]
LSNRCTL> services [listener_name]
LSNRCTL> reload [listener_name]

LSNRCTL> help
LSNRCTL> version [listener_name]    -- get version information of the listener

LSNRCTL> save_config [listener_name]    -- saves configuration changes to parameter file
LSNRCTL> trace OFF | USER | ADMIN | SUPPORT [listener_name]    -- set tracing to the specified level
LSNRCTL> spawn [listener_name] spawn_alias [(ARGUMENTS='arg0, arg1,...')]
LSNRCTL> change_password [listener_name]   -- changes the password of the listener

LSNRCTL> set [sub_command]
password                           rawmode                            
displaymode                        trc_file                           
trc_directory                      trc_level                          
log_file                           log_directory                      
log_status                         current_listener                   
inbound_connect_timeout            startup_waittime                   
save_config_on_stop                dynamic_registration               
enable_global_dynamic_endpoint     connection_rate_limit 

LSNRCTL> show [sub_command]
rawmode                            displaymode                        
rules                              trc_file                           
trc_directory                      trc_level                          
log_file                           log_directory                      
log_status                         current_listener                   
inbound_connect_timeout            startup_waittime                   
snmp_visible                       save_config_on_stop                
dynamic_registration               enable_global_dynamic_endpoint     
oracle_home                        pid                                
connection_rate_limit

LSNRCTL> quit
LSNRCTL> exit

Resources

    Oracle Database Net Services Administrator's Guide