Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Wednesday, September 16, 2015

Manage Oracle network processes

Manage Oracle network processes is all about lsnrctl utlity:

[oracle@collabn1 ~]$ lsnrctl

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-SEP-2015 19:25:19

Copyright (c) 1991, 2009, Oracle.  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             
change_password     quit                exit              
set*                show*             

LSNRCTL>

LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
The command completed successfully


LSNRCTL> start
Starting /u01/app/oracle/product/11.2.0.2/SHAIKPROD/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/collabn1/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=collabn1.shaiksameer)(PORT=1621)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                16-SEP-2015 19:26:36
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/collabn1/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=collabn1.shaiksameer)(PORT=1621)))
Services Summary...
Service "MYDB" has 1 instance(s).
 Instance "MYDB", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl_dgmgrl.shaiksameer" has 1 instance(s).
 Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                16-SEP-2015 19:26:36
Uptime                    0 days 0 hr. 0 min. 2 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/collabn1/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=collabn1.shaiksameer)(PORT=1621)))
Services Summary...
Service "MYDB" has 1 instance(s).
 Instance "MYDB", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl_dgmgrl.shaiksameer" has 1 instance(s).
 Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>

LSNRCTL> services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
Services Summary...
Service "MYDB" has 1 instance(s).
 Instance "MYDB", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
     "DEDICATED" established:0 refused:0
        LOCAL SERVER
Service "orcl_dgmgrl.shaiksameer" has 1 instance(s).
 Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
     "DEDICATED" established:0 refused:0
        LOCAL SERVER
The command completed successfully


LSNRCTL> version
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
   TNS for Linux: Version 11.2.0.1.0 - Production
   Unix Domain Socket IPC NT Protocol Adaptor for Linux: Version 11.2.0.1.0 - Production
   Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production
   TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production,,
The command completed successfully


LSNRCTL> reload
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
The command completed successfully
LSNRCTL>


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.ora file.

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

TRACE

Purpose
To turn on tracing for the listener.

This command has the same functionality as SET TRC_LEVEL command.


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

LSNRCTL> trace admin
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
Opened trace file: /u01/app/oracle/diag/tnslsnr/collabn1/listener/trace/ora_11154_140186301859584.trc
The command completed successfully

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                16-SEP-2015 19:26:36
Uptime                    0 days 0 hr. 9 min. 32 sec
Trace Level               admin
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/collabn1/listener/alert/log.xml
Listener Trace File       /u01/app/oracle/diag/tnslsnr/collabn1/listener/trace/ora_11154_140186301859584.trc
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=collabn1.shaiksameer)(PORT=1621)))
Services Summary...
Service "MYDB" has 1 instance(s).
 Instance "MYDB", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl_dgmgrl.shaiksameer" has 1 instance(s).
 Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
No changes to save for LISTENER.
The command completed successfully


LSNRCTL> show
The following operations are available after show
An asterisk (*) denotes a modifier or extended 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                              

LSNRCTL> set trc_level admin
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
LISTENER parameter "trc_level" set to admin
The command completed successfully


LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
Saved LISTENER configuration parameters.
Listener Parameter File   /u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin/listener.ora
Old Parameter File   /u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin/listener.bak
The command completed successfully

/u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin

-rw-r--r-- 1 oracle oinstall 1306 Sep 16 14:20 listener.bak
-rw-r--r-- 1 oracle oinstall 1428 Sep 16 19:41 listener.ora


/u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin
[oracle@collabn1 admin]$ vi listener.ora

#----ADDED BY TNSLSNR 16-SEP-2015 19:41:20---
TRACE_LEVEL_LISTENER = admin
#--------------------------------------------


LSNRCTL> show pid
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
PID=(11154)
The command completed successfully
LSNRCTL>


LSNRCTL> show log_file
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
LISTENER parameter "log_file" set to /u01/app/oracle/diag/tnslsnr/collabn1/listener/alert/log.xml
The command completed successfully

LSNRCTL> show snmp_visible
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
LISTENER parameter "snmp_visible" set to OFF
The command completed successfully

LSNRCTL> show dynamic_registration
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
LISTENER parameter "dynamic_registration" set to ON
The command completed successfully

LSNRCTL> show startup_waittime
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
LISTENER parameter "startup_waittime" set to 0
The command completed successfully

LSNRCTL> set trc_level off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
LISTENER parameter "trc_level" set to off
The command completed successfully


LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.shaiksameer)(PORT=1621)))
Saved LISTENER configuration parameters.
Listener Parameter File   /u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin/listener.ora
Old Parameter File   /u01/app/oracle/product/11.2.0.2/SHAIKPROD/network/admin/listener.bak
The command completed successfully


[oracle@collabn1 admin]$ vi listener.ora

#----ADDED BY TNSLSNR 16-SEP-2015 19:41:20---
TRACE_LEVEL_LISTENER = off
#--------------------------------------------

No comments: