Listener setup from "Dan's Oracle7 Guide"

From: Daniel B. Bikle <dbikle_at_alumni.cco.caltech.edu>
Date: 28 Aug 1993 20:01:30 GMT
Message-ID: <DBIKLE.93Aug28130131_at_alumni.cco.caltech.edu>


The following discussion is an excerpt from "Dan's Oracle7 Guide".

While the guide could not be described as a great literary work, it might prove useful to those DBA's and Application Developers who work with Oracle7.

The guide will be finished sometime in October. If you want a copy, I'll put you on my mailing list.

All of the trademarks mentioned in this excerpt are owned by their respective owners.

-Dan



Daniel B. Bikle
dbikle_at_alumni.caltech.edu
415/854-9542

listener_setup



Setting up the listener is a simple procedure. First, the listener configuration file needs to be created and then filled with proper values.

Next, an initialization parameter needs to be set.

Then, we need to define the port number in either /etc/services or the NIS services map.

Finally, the listener process needs to be started.

The Listener Configuration File



A sample Listener Configuration File is displayed below:

# listener.ora

# customized from ~network/config/samples/server/listener.ora

# The next line below is the name of the listener alias.
# The default name of the listener alias is "LISTENER".
# If you define a name other than "LISTENER", remember to
# put the name in the lsnrctl command line when you start
# the listener.
# example: lsnrctl start TCPLISTENER
TCPLISTENER =
  (ADDRESS_LIST =

        (ADDRESS = 
          (PROTOCOL = TCP)
          (HOST = ava2)
          (PORT = 2525)
        )

  )
STARTUP_WAIT_TIME_TCPLISTENER = 0
CONNECT_TIMEOUT_TCPLISTENER = 10
SID_LIST_TCPLISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = x7)
      (oracle_home=/q/o7)

    )
  )
PASSWORDS_TCPLISTENER = hello
TRACE_LEVEL_TCPLISTENER = OFF
# end of listener.ora

Setting The Initialization Parameter



A sample Initialization Parameter is displayed below:

        MTS_LISTENER_ADDRESS="(ADDRESS=(PROTOCOL=TCP)(HOST=ava2)(PORT=2525))"

Notice how it corresponds exactly with "ADDRESS_LIST" in listener.ora

Starting The Listener Process



This is done with a simple shell command:

        lsnrctl start TCPLISTENER

If successful, the shell should respond with something like:



ava2-o7-% lsnrctl start TCPLISTENER

LSNRCTL for SunOS: Version 2.0.12.1.0 - Developer's Release

Copyright (c) Oracle Corporation 1992. All rights reserved.

Starting /q/o7/bin/tnslsnr: please wait...

Opened parameter file: /q/o7/network/admin/listener.ora Opened log file: /q/o7/network/log/tcplistener.log Resolved CONNECT_TIMEOUT_TCPLISTENER to: 10 Resolved PRESPAWN_TCPLISTENER to: 0
Resolved STARTUP_WAIT_TIME_TCPLISTENER to: 0 Resolved TRACE_LEVEL_TCPLISTENER to: OFF LISTENING ON: (DESCRIPTION=(CONNECT_TIMEOUT=10)(ADDRESS=(PROTOCOL=TCP) (HOST=ava2)(PORT=2525)))

STATUS of the LISTENER


Alias                     TCPLISTENER
Version                   TNSLSNR for SunOS: Version 2.0.12.1.0 
Start Date                9-JUN-92 16:57:19
Uptime                    0 days 0 hr. 0 min. 1 sec
Trace Level               OFF
Security                  ON
Listener Parameter File   /q/o7/network/admin/listener.ora
Listener Log File         /q/o7/network/log/tcplistener.log
Services Summary...
  x7
The command completed successfully

A process listing will verify it started (notice how the process is owned by root rather than the dbs owner):

USER       PID %CPU %MEM   SZ  RSS TT STAT START  TIME COMMAND
root       425  0.0  3.8  144  816 ?  S    16:57   0:00 /q/o7/bin/tnslsnr TCPL



If we forget to put the listener alias at the end of the command line, lsnrctl will respond with an error message like this:


LSNRCTL for SunOS: Version 2.0.12.1.0 - Developer's Release

Copyright (c) Oracle Corporation 1992. All rights reserved.

Starting /q/o7/bin/tnslsnr: please wait...

Opened parameter file: /q/o7/network/admin/listener.ora Opened log file: /q/o7/network/log/listener.log Resolved CONNECT_TIMEOUT_LISTENER to: 10 Resolved PRESPAWN_LISTENER to: 0
Resolved STARTUP_WAIT_TIME_LISTENER to: 0 Resolved TRACE_LEVEL_LISTENER to: OFF

TNS-01151: Must specify addresses for listener alias: LISTENER
NNC-00401: API initialization failed
 NL-00404: null context
------------------------------------------------------------------

The error message is saying we have an error in the file named listener.ora. The default listener alias is "LISTENER" which is not even defined in the listener.ora displayed above. The only listener alias defined in the above listener.ora is "TCPLISTENER". Notice how a reminder about using the listener alias has been commented into the listener.ora displayed above.


Received on Sat Aug 28 1993 - 22:01:30 CEST

Original text of this message