lsnrctl

The lsnrctl utility manages the Oracle listener processes.  The Oracle listener process is required for database applications to access the database through SQL*Net or Net8.  lsnrctl requires entries in the listener.ora file that specify the port for that listener.  The listener.ora file is the configuration file for the network listener. It resides on the server and defines the network listener address, the SID for the database for which it listens, and other optional parameters for tracing and logging.

 

The lsnrctl command can be executed without parameters, in which the lsnrctl shell will be invoked, or it can execute commands directly when specified on the command line. 

 

$ lsnrctl

 

LSNRCTL for Solaris: Version 9.2.0.1.0 - Production on 30-JAN-2003 11:54:13

 

(c) Copyright 1998 Oracle Corporation.  All rights reserved.

 

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> help

The following operations are available

An asterisk (*) denotes a modifier or extended command:

 

start               stop                status

services            version             reload

save_config         trace               spawn

dbsnmp_start        dbsnmp_stop         dbsnmp_status

change_password     quit                exit

set*                show*

 

The following commands are used to manage the listener: 

 

·     start – Starts the listener with the name specified, otherwise LISTENER will be used.  For Windows systems, the listener can also be started and stopped from the Control Panel.

·     stop – Stops the listener.  For Windows systems, the listener can also be started and stopped from the Control Panel.

·     status – Provides status information about the listener, including start date, uptime, and trace level.

·     services – Displays each service available, along with the connection history.

·     version – Displays the version information of the listener.

·     reload – Forces a read of the configuration file in order for new settings to take effect without stopping and starting the listener.

·     save_config – Creates a backup of the existing listener.ora file and saves changes to the current version.

·     trace – Sets the trace level to one of the following – OFF, USER, ADMIN, or SUPPORT.

·     spawn – Spawns a program that runs with an alias in the listener.ora file.

·     dbsnmp_start – Starts the DBSNMP subagent.

·     dbsnmp_stop – Stops the DBSNMP subagent.

·     dbsnmp_status – Displays the status of the DBSNMP subagent.

·     change_password – Sets a new password for the listener.

·     quit and exit – Exits the utility.

·     set – Changes the value of any parameter.  Everything that can be shown can be set.

·     show – Displays current parameter settings.

LSNRCTL> show

The following operations are available after show

An asterisk (*) denotes a modifier or extended command:

 

rawmode                 displaymode             trc_file

trc_directory           trc_level               log_file

log_directory           log_status              current_listener

startup_waittime        snmp_visible            save_config_on_stop 

Any of the above options can be shown (with the show command) or set.

 

The start command will start the default listener (named LISTENER); otherwise the name can be specified as the second parameter.  Once started, the status can be determined using the status command:

 

LSNRCTL> status

Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     GRACELANV8_LSNR

Version                   TNSLSNR for Solaris: Version 9.0.1.0.0 - Production

Start Date                07-NOV-2002 18:15:39

Uptime                    84 days 19 hr. 45 min. 18 sec

Trace Level               off

Security                  OFF

SNMP                      OFF

Listener Parameter File   /var/opt/oracle/listener.ora

Listener Log File         /usr/oracle/9.0.1/network/log/gracelanv8_lsnr.log

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gracelan.bmc.com)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gracelan.bmc.com)(PORT=1525)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.18.16.215)(PORT=8080))(PRESENTATION=http://admin)(SESSION=RAW))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=172.18.16.215)(PORT=9090))(PRESENTATION=http://admin)(SESSION=RAW))

Services Summary...

Service "GRA901m" has 1 instance(s).

  Instance "GRA901m", status UNKNOWN, has 1 handler(s) for this service...

Service "GRA901m.world" has 1 instance(s).

  Instance "GRA901m", status READY, has 1 handler(s) for this service...

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully  

 

The status shows a great deal information, including the uptime, trace level, and logs files.  In addition, the status option displays the file in which the parameters for the listener are defined, /var/opt/oracle/listener.ora.

 
 
Copyright 2003, Rampant Tech Press, Dave Moore - All Rights Reserved. All product names and trademarks are property of their respective owners.