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;

Shared Pool Tuning: Cursor Tuning (Tuning Open_Cursors, Session_Cached_Cursors, Cursor_Space_For_Time)

Shared Pool Tuning: Cursor Tuning The three most important parameter for shared pool tuning are OPEN_CURSORS , SESSION_CACHED_CURSORS and CURSOR_SPACE_FOR_TIME. But most of the time we see that these two parameters SESSION_CACHED_CURSORS and CURSOR_SPACE_FOR_TIME are ignored or unused . OPEN CURSORS Open cursors take up space in the shared pool, in the library cache. OPEN_CURSORS sets the maximum number of cursors each session can have open, per session. For example, if OPEN_CURSORS is set to 1000, then each session can have up to 1000 cursors open at one time. V$open_cursor shows cached cursors, not currently open cursors, by session. If you’re wondering how many cursors a session has open, don’t look in v$open_cursor. It shows the cursors in the session cursor cache for each session, not cursors that are actually open.  To monitor open cursors, query v$sesstat where name= ’opened cursors current’ . This will give the number of currently opened cursors, by session:

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 "            In Cloud Control Release 12.1.0.2, the following dialog box will be displayed if the Agent is still monitoring targets. Click Continue. You can then remove all targets (usin