CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle Listener
Version 11.1
 
Listener Commands
The listener's involvement is summarized as:
  • the listener catches the request
  • spawns or requests a database process/thread
  • redirects or passes the connection to the process/thread, usually on a different port
  • gets out of the way
change_password set an encrypted listener password
c:\oracle\product\ora102\bin> lsnrctl start
LSNRCTL> change_password
Old password:
New password:
Reenter new password:
LSNRCTL> save_config
exit quit the listener application
c:\oracle\product\ora10\bin> lsnrctl
LSNRCTL> exit
help view help information
c:\oracle\product\ora10\bin> lsnrctl start

or

c:\oracle\product\ora10\bin> lsnrctl
LSNRCTL> help
kill on *NIX ps -ef|grep tnslsnr|awk '{ print $2; }'|xargs kill -9
quit quit the listener application
c:\oracle\product\ora10\bin> lsnrctl
LSNRCTL> quit
reload Causes a reread of the listener.ora file. Enables the addition or modification of statically configured services without stopping the listener.

In addition, the database services, instances, service handlers, and listening endpoints that were dynamically registered with the listener are unregistered and subsequently registered again.
LSNRCTL> reload
save_config Use the SAVE_CONFIG command to compare the current configuration state of the listener, including trace level, trace file, trace directory, and logging to the listener.ora file. Any changes are stored in listener.ora, preserving formatting, comments, and case as much as possible. Prior to modification of the listener.ora file, a backup of the file, called listener.bak, is created.
See change_password: Above
service View the configured listener service
LSNRCTL> serv

set

Parameter

Syntax & Usage

current_listener set current_listener <listener_name>
LSNRCTL> set current_listener uwlistener
displaymode set displaymode <RAW | COMPAT | NORMAL | VEBOSE>
LSNRCTL> set displaymode VERBOSE
inbound_connect_timeout set inbound_connect_timeout <value>
LSNRCTL> set inound_connect_timeout 0
log_directory set log_directory <directory_path>
LSNRCTL> set log_directory c: emp
log_file set log_file <file_name>
LSNRCTL> set log_file uwlistener.log
log_status set log_status < ON | OFF>
LSNRCTL> set log_status ON
password set password
LSNRCTL> set password
Password: 
rawmode set rawmode <ON | OFF>
LSNRCTL> set rawmode OFF
save_config_on_stop set save_config_on_stop <ON | OFF>
LSNRCTL> set save_config_on_stop ON
startup_waittime set startup_waittime <value>
LSNRCTL> set startup_waittime 0 
trc_directory set trc_directory <directory path>
LSNRCTL> set trc_directory c: emp
trc_file set trc_level <file_name>
LSNRCTL> set trc_file uwlistener.trc
trc_level set trc_level <value>
Value Description
0 - 1 off
2 - 3 err
4 - 5 user
6 - 14 admin
15 dev
16 - 99 support
LSNRCTL> set trc_level 0
services view the current listener services
c:\oracle\product\ora10\bin> lsnrctl services

show

Parameter

Syntax & Usage

current_listener show current_listener <listener_name>
LSNRCTL> show current_listener
displaymode show displaymode
LSNRCTL> show displaymode
inbound_connect_timeout  
LSNRCTL> show
log_directory show log_directory
LSNRCTL> show log_directory
log_file show log_file
LSNRCTL> show
log_status show log_status

ON if listener activity is logged
LSNRCTL> show log_status
rawmode show rawmode
LSNRCTL> show rawmode
save_config_on_stop show save_config_on_stop
LSNRCTL> show
snmp_visible show snmp_visible
LSNRCTL> show snmp_visible
startup_waittime show startup_waittime
LSNRCTL> show startup_waittime

Default is 0
trc_directory show trc_directory
show trc_directory
trc_file show trc_file

Default is listener.trc
show trc_file
trc_level show trc_level
show trc_level
start start the listener
c:\oracle\product\ora10\bin> lsnrctl start
status view the current listener status
c:\oracle\product\ora10\bin> lsnrctl status
stop stop the listener
c:\oracle\product\ora10\bin> lsnrctl stop
trace  
version Show the currently installed listener version
c:\oracle\product\ora10\bin> lsnrctl version
 
Listener Parameters
Prevent remote modification of listener.ora using lsnrctl commands ADMIN_RESTRICTIONS_[listener_name]=<ON | OFF>
ADMIN_RESTRICTIONS_ORABASE=ON
 
Listener.ora Samples

Typical Listener.ora file for standalone Oracle.

For a RAC cluster follow the RAC link at page bottom.

# listener.ora Network Configuration File: 
# c:\oracle\product\ora10 etwork\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oracle\product\ora10)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = orabase)
      (ORACLE_HOME = C:\oracle\product\ora10)
    (SID_NAME = orabase)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = perrito)(PORT = 1521))
    )
  )
)
Queue Size Add the queuesize parameter in your listener.ora file in the address description. By default oracle is able to open only 16 simultaneous connections

The result should look like this:
(ADDRESS=
  (PROTOCOL = TCP)(HOST = your-hostname)(PORT = 1521)
  (QUEUESIZE = 30)
)
Trace Levels TRACE_LEVEL_<listener_name> = <value>

Value equivalents:
OFF (equivalent to 0) provides no tracing
USER (equivalent to 4) identify user error error conditions
ADMIN (equivalent to 6) identify installation-specific problems
SUPPORT (equivalent to 16) provides trace information for support

Trace file results are written to $ORACLE_HOME/network/trace.
TRACE_LEVEL_LISTENER = USER
Force the database to register, or reregister, with the listener ALTER SYSTEM REGISTER;
ALTER SYSTEM REGISTER;
 
Related Topics
RAC
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [109 users online]    © 2010 psoug.org