7

I have an Oracle DB working in production for more than a year.
I have my listener working:

[oracle@base admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0     
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                02-NOV-2016 14:22:38
Uptime                    1 days 20 hr. 3 min. 13 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /o/app/oracle/diag/tnslsnr/base/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=base)(PORT=1521)))
Services Summary...
Service "BASE" has 1 instance(s).
  Instance "BASE", status READY, has 1 handler(s) for this service...
Service "BASEXDB" has 1 instance(s).
  Instance "BASE", status READY, has 1 handler(s) for this service...
The command completed successfully

But I have no listener.ora:

ls /o/app/oracle/product/DB_11.2_SE/dbhome_2/network/admin/
samples  shrept.lst  tnsnames.ora

This is the content of my tnsnames.ora:

$ cat tnsnames.ora 
BASE =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.20.19)(PORT = 1521))
      (LOAD_BALANCE = yes)
    )
    (CONNECT_DATA =
      (SERVICE_NAME = BASE)
    )
  )


ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.20.20)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

How is this possible? As far as I know, for the listener to work, I have to have a listener.ora file.

I have another Oracle database installed, and if I execute lsnrctl status, in the output I can see a line containing Listener Parameter File /o/app/oracle/product/11.2/dbhome/network/admin/listener.ora, and I am not seeing it here. Also I have executed locate listener.ora, and nothing.

0

2 Answers 2

4

"As far as I know, for the listener to work, I have to have listener.ora file."

Starting with 8.1.5, listener.ora is optional for a default listener.

Starting the Listener without a LISTENER.ORA (Doc ID 208968.1)

Purpose

To publicise the fact that from Oracle8i (8.1.5) onward, a LISTENER.ORA is no longer required in order to start the Default Oracle Net Listener.

6

You don't need a listener.ora. The listener will happily start without one, but will just start without supporting any services. pmon will periodically register databases with the listener, but you can force registration manually.

Move the file away:

C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN>move listener.ora listener.foo
    1 file(s) moved.

Start the listener:

C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN>lsnrctl start

LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 04-NOV-2016 13:50
:03

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Starting tnslsnr: please wait...

TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Production
Log messages written to C:\oraclexe\app\oracle\diag\tnslsnr\host\listener\alert\log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Produ
ction
Start Date                04-NOV-2016 13:50:08
Uptime                    0 days 0 hr. 0 min. 5 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         C:\oraclexe\app\oracle\diag\tnslsnr\host\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host)(PORT=1521)))
The listener supports no services
The command completed successfully

Register the database with the listener:

C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Fri Nov 4 13:50:38 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> alter system register;

System altered.

SQL>

The listener now supports the database:

C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN>lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 04-NOV-2016 13:51
:20

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Produ
ction
Start Date                04-NOV-2016 13:50:08
Uptime                    0 days 0 hr. 1 min. 15 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         C:\oraclexe\app\oracle\diag\tnslsnr\host\list  ener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "XEXDB" has 1 instance(s).
  Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
  Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully

C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.