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

ORACLE FLASH RECOVERY AREA USAGE QUERY

FINDING ORACLE FLASH RECOVERY AREA USAGE SELECT NAME,        (SPACE_LIMIT / 1024 / 1024 / 1024) SPACE_LIMIT_GB,          ((SPACE_LIMIT - SPACE_USED + SPACE_RECLAIMABLE) / 1024 / 1024 / 1024) AS SPACE_AVAILABLE_GB,        ROUND((SPACE_USED - SPACE_RECLAIMABLE) / SPACE_LIMIT * 100, 1) AS PERCENT_FULL   FROM V$RECOVERY_FILE_DEST;

All Dictionary View Tables:

All Dictionary View Tables: TABLE_NAME COMMENTS ALL_ALL_TABLES Description of all object and relational tables accessible to the user ALL_APPLY Details about each apply process that dequeues from the queue visible to the current user ALL_APPLY_CONFLICT_COLUMNS Details about conflict resolution on tables visible to the current user ALL_APPLY_DML_HANDLERS Details about the dml handler on tables visible to the current user ALL_APPLY_ENQUEUE Details about the apply enqueue action for user accessible rules where the destination queue exists and is visible to the user ALL_APPLY_ERROR Error transactions that were generated after dequeuing from the queue visible to the current user ALL_APPLY_EXECUTE Details about the apply execute action for all rules visible to the user ALL_APPLY_KEY_COLUMNS Alternative key columns for a STREAMS table visible to the current user ALL_APPLY_PARAME...

How to delete/remove Management Agent from Oracle Enterprise Manager 12C

  1. Before you deinstall a Management Agent, do the following:     a. Stop the Agent using command from Management Agent home:                 cd /u01/oemcc_latest/core/12.1.0.2.0/bin/                 $ emctl stop agent     b. Wait for the Management Agent to go to the unreachable state in the Cloud Control console.     c. It is mandatory to delete the Management Agent and their monitored targets using any of the following methods: Remove the Agent target manually from the console: 1. Login to 12C Cloud Control 2. Navigate to Setup => Manage Cloud Control => Agents 3. Go to the Home page of the Agent that you want to remove 4. Expand the drop-down menu near the " Agent " 5. Expand the " Target Setup " option 6. Select " Remove Target "   ...