"The object of
the superior man is truth." -Confucius |
Server Side Configuration
You configure LISTENER in
your Database Server to listen and establish connections for incoming
client requests. You can have multiple listeners running on a database
server. You should configure a listener with one or more protocol
addresses that specifies its listening port numbers. A client must be
configured with the same type of protocol addresses to converse with
the listener. On the client side, the PMAN background process provides
information to the listener about its instance. Its job is to make
sure that if a user process got disconnected, clean the entire
remaining task.
You connect to the Oracle
database either through a dedicated server or shared server.
Configuring a Listener
The listener"s
configuration file is stored in listener.ora, which is located in the
default directory $ORACLE_HOME/network/admin on UNIX and %ORACLE_HOMEon
Windows. If you are going to relocate the configuration file make sure
to set the TNS_ADMIN environment variable.
An example of listener.ora:
LISTENER4MYDBS=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)
(HOST=mycomupter) (PORT=1521))
(ADDRESS=(PROTOCOL=ipc)
(KEY=extproc))
)
)
SID_LIST_LISTENER4MYDBS=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=mydbs.company)
(ORACLE_HOME=/u01/app/oracle/product/9.2.0)
(PROGRAM=extproc)
SID_NAME=mydbs)
)
)
LISTENER4MYDBS is just a
listener name and can be any name. The listening location area (ADDRESS=)
specifies where a listener is listening for a connection.
For each address you may
use a different protocol type such as TCP, NMP, IPC, SPX and etc. If
you use TCP, you should specify the host name (or an IP address) and
the port number to be used. If you use NMP (Named Pipes) for a network
using Novel, you should specify your Machine Name and the Pipe Name.
If you use IPC (Interprocess Communication), you should specific the
library name that will be accessed on the same node. The IPC protocol
will be used only when client and server run on the same machine or
node. If you use SPX, the IPX/SPX Microsoft protocol, you should
specify a service name. For other protocol, you may have to specify
the relevant information for establishing the Oracle connectivity.
The resets of above
parameter are very much self-explanatory.
Also, you can have the
following control parameter settings:
ADMIN_RESTRICTIONS_ listener4mydbs=TRUE
It will restrict any
modification to the listener dynamically using the SET command.
PASSWARDS_ listener4mydbs=(X6Z76H07Y34D)
It enforces to enter the
password for stopping the listener.
LOG_DIRECTORY_ listener4mydbs=$ORACLE_HOME/network/admin
It defines a log directory
destination.
LOG_FILE_ listener4mydbs=listener4mydbs.log
It defines a log file name.
LOGGING_ listener4mydbs=ON
It enables or disables
logging.
TRACE_DIRECTORY_ listener4mydbs=$ORACLE_HOME/network/admin/trace
It defines a trace
directory destination.
TRACE_FILE_ listener4mydbs=listener4mydbs.trc
It defines a trace file
name.
TRACE_LEVEL_ listener4mydbs=(OFF|ADMIN|USER|SUPPORT)
It enable or disable (OFF)
a trace for debugging purposes. You use the SUPPORT level only when
requested by Oracle Support. The USER level provides user trace and
the ADMIN level provides administration information.
Listener Control Commands
# lsnrctl command
listener_name
General format.
# lsnrctl help
It will list lsnrctl
commands.
# lsnrctl stop
listener4mydbs
It stops the listener.
# lsnrctl start
listener4mydbs
It starts listener.
# lsnrctl reload
listener4mydbs
It reloads the modified
listener file.
# lsnrctl status
listener4mydbs
It displays the listener"s
status.
# lsnrctl services
It displays the registered
services.
# lsnrctl
It will enable listener
utility.
LSNRCTL>
You can use listener
utility to use the SHOW and SET commands. For example setting
password.
LSNRCTL> SET PASSWORD
Configuring Service
Registration
The SERVICE_NAMES and the
INSTANCE_NAME parameter must be set in the database initialization
parameter file (PFILE).
SERVICE_NAMES= mydbs.company
INSTANCE_NAME=mydbs
"When I hear
somebody sigh, 'Life is hard,' I am always tempted to ask,
'Compared to what?'" -Sydney Harris |
Questions:
Q: How do you configure a
LISTENER in your database server?
Q: Can you have multiple
listeners running on a database server?
Q: How do you configure a
LISTENER with one or more protocol?
Q: Describe the PAMN
background process jobs?
Q: Describe the following
listener configuration file (listener.ora).
LISTENER4MYDBS=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)
(HOST=mycomupter) (PORT=1521))
(ADDRESS=(PROTOCOL=ipc)
(KEY=extproc))
)
)
SID_LIST_LISTENER4MYDBS=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=mydbs.company)
(ORACLE_HOME=/u01/app/oracle/product/9.2.0)
(PROGRAM=extproc)
SID_NAME=mydbs)
)
)
Q: How can you assign a
password to you listener?
Q: How do you turn on the
trace utility on a listener on the user level?
Q: How do you start a
listener?
Q: How do you stop a
listener?
Q: What does the reload
command do in the listener?
|