TALK ABOUT
MULTIPLE LISTENERS
This short article covers
the following
§
Multiple Listeners
§
Multiple Listener SETUP
§
How to start multiple listeners?
§
What are the available parameters, which I can set while
listener is running?
§
How do I see the current setting without opening the
listener.ora?
There are two main
reasons for this
1) It allows you to do
changes with out stopping the client request to the server.
Listener takes the
request from the client and hands over to the server process. Once the server
process completes the request, it is the listener responsibility to sends the
response back to the respective client. In absence of listener, client can not
talk to the server. By having multiple listeners, you could do changes in one
of the listener by stopping it, while other one is handling the request. Once
your changes will complete, you can start the listener and stop the other one
to do changes.
2) If one
of the listener is not able to handle the communication by any means, the other
can server the request.
If your system has multiple SID say one for
Production and one for development on the same machine, by keeping multiple
listeners you can easily do the maintenance work.
Multiple
Listener SETUP
To set the multiple listeners, you have to add
new listener entry in the LISTENER.ORA file ($ORACLE_HOME/network/admin). The following is the example of setting two
listener with the name LISTPROD1 and LISTPROD2 in the LISTENER.ORA file.
|
|
LISTENER.ORA
Network Configuration File: D:\oracle\ora92\network\admin\listener.ora
# generated by Oracle configuration tools.
# listprod1 is the name of the first listener LISTPROD1
=
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY =
EXTPROC0))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
sameer)(PORT = 1521))
)
)
)
# SID list of the listener listprod1 SID_LIST_LISTPROD1
=
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\ora92)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = samor92)
(ORACLE_HOME = D:\oracle\ora92)
(SID_NAME = samor92)
)
)
# listprod2 is the name of the second listener LISTPROD2
=
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY =
EXTPROC0))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
sameer)(PORT = 1526))
)
)
)
# SID list of the listener listprod1 SID_LIST_LISTPROD2
=
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\ora92)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = samor92)
(ORACLE_HOME = D:\oracle\ora92)
(SID_NAME = samor92)
)
) |
Starting listener listprod1
C:\>lsnrctl
Starting listener lisprod2
In oracle 8.1.6 or lower, you have the
following limitation
Ø You can only have one active Listener.ora file. If a SID is defined in more than one listener.ora, you will see the following error in the logfile: "Multiple Listeners found for SID ..."
Ø If multiple Listeners are defined in the Listener.ora, a SID can only be defined in one of the Listeners. i.e. No Support for Multiple Listeners for the same SID
What are the available
parameters, which I can set, while listener is running?
The list of the parameters which you can set can be viewed
as
LSNRCTL>
help set
The following operations are available after set
password raw mode display mode
trc_file trc_directory trc_level
log_file log_directory log_status
current_listener startup_waittime save_config_on_stop
For setting the log directory command is
LSNRCTL>
set log_directory c:\temp\listlog1
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
LISTENER parameter "log_directory" set to
c:\temp\listlog1
The command completed successfully
LSNRCTL>
Now the listener.log will be created in c:\temp\listlog1
directory.
To record the changed permanently in the listener.ora use
the save config command as
LSNRCTL>
save_config
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
Saved LISTENER configuration parameters.
Listener Parameter File
D:\oracle\ora92\network\admin\listener.ora
Old Parameter File
D:\oracle\ora92\network\admin\listener.bak
The command completed successfully
If you wish to save current configuration automatically
when ever you stop and restart the listener, you must add the parameter
SAVE_CONFIG_ON_STOP_LISTENER = ON in the listener.ora prameter. Whenever you
stop and restart the listener , the listener will be backuped up automatically
with the extension .bak in $ORACLE_HOME/network/admin and new listener.ora will
be created.
ADMIN_RESTRICTION_<LISTENER> = ON|OFF , if it is ON , you
cannot change the listener setting while
it is running.
How do I see the
current setting without opening the listener.ora?
With the help of show command, you can see the listing of
commands whose setting you can see without physically opening of the
listener.ora file.
LSNRCTL>
show help
The following operations are available after show
An asterisk (*) denotes a modifier or extended command:
rawmode displaymode trc_file
trc_directory trc_level log_file
log_directory log_status current_listener
startup_waittime snmp_visible save_config_on_stop
Check
the value of currently setting of log_directory
LSNRCTL>
show log_directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
LISTENER parameter "log_directory"
set to c:\temp\listlog1
The command completed successfully
Check
the value of currently setting of trc_level
LSNRCTL>
show trc_level
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
LISTENER parameter "trc_level"
set to off
The command completed successfully
Hope the above
information will help …
--Author
Sameer
Wadhwa
Copyright© Oracle Techniques www.SamOraTech.com
Disclaimer:
The author does not guarantee that this information is
error-free.
If any errors are
found, please report them to author at Wadhwa_s@hotmail.com
or SamOracle@Yahoo.com
Ask and Solve Database Problems at OraTechSupportGroup
What do you think about Oracle
Techniques?