Skip to main content

All about LSNRCTL, Listener Control Utility of ORACLE


To see the available command in listener control utility:

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

RELOAD

Purpose
To reread the listener.ora file. This command enables you to add or change statically configured services without actually stopping the listener.
Syntax
From the operating system:
lsnrctl RELOAD listener_name
From the Listener Control utility:
LSNRCTL> RELOAD listener_name

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

SET LOG_DIRECTORY

Purpose
To set destination directory where the listener log file is written. By default, the log file is written to the ORACLE_HOME/network/logdirectory.
Syntax
From the operating system:
lsnrctl SET LOG_DIRECTORY directory
From the Listener Control utility:
LSNRCTL> SET LOG_DIRECTORY directory
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

SET LOG_FILE

Purpose
To set the name for the listener log file. By default, the log file name is listener.log.
Syntax
From the operating system:
lsnrctl SET LOG_FILE file_name
From the Listener Control utility:
LSNRCTL> SET LOG_FILE file_name

SET LOG_STATUS

Purpose
To turn listener logging on or off.
Syntax
From the operating system:
lsnrctl SET LOG_STATUS {on | off}
From the Listener Control utility:
LSNRCTL> SET LOG_STATUS {on | off}

SET SAVE_CONFIG_ON_STOP

Purpose
To specify whether changes made to the parameter values for the listener by the SET commands are to be saved to thelistener.ora file at the time the listener is stopped with the STOP 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}

SET TRC_DIRECTORY

Purpose
To set the destination directory where the listener trace files are written. By default, the trace file are written to theORACLE_HOME/network/trace directory.
Syntax
From the operating system:
lsnrctl SET TRC_DIRECTORY directory
From the Listener Control utility:
LSNRCTL> SET TRC_DIRECTORY directory

SET TRC_FILE

Purpose
To set the name of the listener trace file. By default, the trace file name is listener.trc.
Syntax
From the operating system:
lsnrctl SET TRC_FILE file_name
From the Listener Control utility:
LSNRCTL> SET TRC_FILE file_name

SET TRC_LEVEL

Purpose
To set a specific level of tracing for the listener.
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

SHOW

Purpose
To view the current parameter values for the listener.
All of the SET parameters have equivalent SHOW parameters.
Syntax
From the operating system:
lsnrctl SHOW parameter
From the Listener Control utility:
LSNRCTL> SHOW parameter

SPAWN

Purpose
To start a program stored on the computer on which the listener is running, and which is listed with an alias in the listener.orafile.
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 off is specified by a listener.ora file entry, similar to the following:
alias = (PROGRAM=(NAME=)(ARGS=)(ENVS=))
For example:
nstest = (PROGRAM=(NAME=nstest)(ARGS=test1)(ENVS='ORACLE_HOME=/usr/oracle'))
Example
This program can then be spawned off using the following command:
lsnrctl SPAWN listener_name nstest


START

Purpose
To start the named listener.
Syntax
From the operating system:
lsnrctl START listener_name
From the Listener Control utility:
LSNRCTL> START listener_name
From the Listener Control utility:
LSNRCTL> START tcp_lsnr

STATUS

Purpose
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.
Syntax
From the operating system:
lsnrctl STATUS listener_name
From the Listener Control utility:
LSNRCTL> STATUS listener_name

STOP

Purpose
To stop the named listener.
Syntax
From the operating system:
lsnrctl STOP listener_name

From the Listener Control utility:
LSNRCTL> STOP listener_name

TRACE

Purpose
To turn on 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 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

VERSION

Purpose
To display the current version of Listener Control utility.
Syntax
From the operating system:
lsnrctl VERSION listener_name
From the Listener Control utility:
LSNRCTL> VERSION listener_name

Comments

Popular posts from this blog

Starting and Stopping the Oracle Enterprise Manager Console

Starting and Stopping the Oracle Enterprise Manager Console To access the Oracle Enterprise  Manager Console from a client browser, the  dbconsole  process needs to be running on the server. The dbconsole process is automatically started after installation. However, in the event of a system restart,change in IP, or other changes, you can start it manually at the command line. To start the  dbconsole  process from the command line: Navigate into your  ORACLE_HOME/bin  directory. Run the following statement: ./emctl start dbconsole Additionally, you can stop the process and view its status. To stop the  dbconsole  process:          ./emctl stop dbconsole To view the status of the  dbconsole  process:         ./emctl status dbconsole -------------------------------------------------------------------------------------------------------

Query to check the OPTIMAL UNDO RETENTION

Query to check the OPTIMAL UNDO RETENTION _____________________________________________________________________________ SELECT d.undo_size / (1024 * 1024) "ACTUAL UNDO SIZE [MByte]",        SUBSTR(e.value, 1, 25) "UNDO RETENTION [Sec]",        ROUND((d.undo_size / (to_number(f.value) * g.undo_block_per_sec))) "OPTIMAL UNDO RETENTION [Sec]"   FROM (SELECT SUM(a.bytes) undo_size           FROM v$datafile a, v$tablespace b, dba_tablespaces c          WHERE c.contents = 'UNDO'            AND c.STATUS = 'ONLINE'            AND b.name = c.tablespace_name            AND a.ts# = b.ts#) d,        v$parameter e,        v$parameter f,        (SELECT MAX(undoblks / ((end_time - begin_time) * 3600 * 24)) undo_block_per_sec  ...

Solution of problem: Resultset Exceeds the Maximum Size (100 MB)

Solution of problem: Resultset Exceeds the Maximum Size (100 MB) I was running a select statement in PL/SQL Developer. it was a short query but the data volume that the query was fetching was huge. But when ever i Click the button Fetch Last Page or press 'ALT+End' button a message box comes after a while saying: Then I started looking for the exact reason of this sort of problem in Google. When I realized there was no direct solution in the web, I started looking the PL/SQL Developer Software menu and found the ultimate solution. The reason of this problem is there is a parameter of maximum result set size in PL/SQL Developer Software which is by default set to 100 MB. To change this parameter you have to go to the following location: 1. Goto Edit Menu and click ' PL/SQL Beautifier Options '. A new window will open. 2. Click SQL Window of " Window Types ". 3. Now Change the value of "Maximum Result Set Size( 0 is unlimited)"  ...