Managing Users  «Prev  Next»

Lesson 5Configuring the listener.ora file
Objective Add a database to your listener.ora file.

Configure listener.ora, add database service

Oracle Net Listener settings can be stored in a text file named listener.ora. In most installations, the file is located under $ORACLE_HOME/network/admin. On Windows, the exact path varies by install, but it typically ends with \network\admin.

In older Oracle versions (and in many legacy tutorials), adding a database meant adding a static entry under a SID_LIST_<listener_name> heading. In modern Oracle releases, the normal approach is dynamic service registration: you keep listener.ora focused on the listener’s network address (host/port), and you ensure the database instance registers its services with that listener.

This lesson shows both approaches:

  1. Historical context: How a legacy SID_LIST_LISTENER block is structured (with a single annotated image).
  2. Current best practice: How to “add a database” in Oracle 23c by enabling/validating dynamic registration.
  3. When static entries are still valid: Cases where a SID_LIST_... entry is still required (for example, external procedures).

SID_LIST_LISTENER structure (historical reference)

The SID_LIST_LISTENER entry marks the list of services that the listener is handling.
Legacy example: A listener.ora file can contain a static service list under SID_LIST_LISTENER.
SID_LIST_LISTENER=
 (SID_LIST=
  (SID_DESC=
   (SID_NAME=PLSExtProc)
   (ORACLE_HOME = C:\Oracle\Ora81)
   (PROGRAM =extproc)
  )
  (SID_DESC=
   (GLOBAL_DBNAME=jonathan)
   (ORACLE_HOME = C:\Oracle\Ora81)
   (SID_NAME=JONATHAN)
  )
)
The SID_LIST_LISTENER entry marks the list of services handled by the listener. The list is enclosed within parentheses.

Slide notes (2–8) consolidated as historical context

  1. Oracle can run multiple listeners. The name (often LISTENER) identifies which listener this configuration applies to.
  2. The listener can have a “SID list” (service list). Each item typically begins with SID_DESC.
  3. PLSExtProc commonly represents the external procedure handler (extproc), used to interface Oracle with external libraries.
  4. A database entry can be recognized because it references a SID_NAME for an instance (rather than only a PROGRAM).
  5. GLOBAL_DBNAME lets clients reference a service name that includes database name + domain (for example, sales.us.example.com).
  6. SID_NAME identifies the instance name used for routing the connection to the correct server process.
  7. ORACLE_HOME tells the listener where the Oracle home is located for that entry.
Practical Oracle Cloud Infrastructure

How to add a database in Oracle 23c

In Oracle 23c-era configurations, you usually do not add a new database by copying SID_DESC blocks. Instead, you make sure the database (and its services) register with the listener. Conceptually, you are “adding” the database by ensuring the listener can see the service.

Step 1: Verify listener address (listener.ora)

Ensure your listener is configured to listen on the correct host and port. A minimal example looks like this:

LISTENER=
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=TCP)(HOST=sale-server)(PORT=1521))
  )

If you are using external procedures, keep the IPC address as well:

LISTENER=
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=TCP)(HOST=sale-server)(PORT=1521))
    (ADDRESS=(PROTOCOL=IPC)(KEY=extproc))
  )

Step 2: Ensure the database registers its service

From SQL*Plus (or SQLcl) as SYSDBA, validate the service configuration. In a multitenant environment, you typically connect users to a service name (often a PDB service), not a SID.

-- Quick checks (names vary by environment)
SHOW PARAMETER service_names
SHOW PARAMETER local_listener

If the listener is not on the default host/port (or you have a custom listener name), set LOCAL_LISTENER and force re-registration:

ALTER SYSTEM SET local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=sale-server)(PORT=1521))' SCOPE=BOTH;
ALTER SYSTEM REGISTER;

Step 3: Confirm the listener sees the service

On the database host, confirm registration from the OS:

lsnrctl status
lsnrctl services

You should see your database service(s) listed. If you do not, typical causes include: wrong host/port, DNS/hosts mismatch, firewall, listener started under a different Oracle home, or a missing/incorrect LOCAL_LISTENER value.

When static SID_LIST entries are still appropriate

Static service registration (SID_LIST_...) is still used in specific scenarios, such as external procedures (extproc) and certain management/monitoring setups. In those cases, you can add a static entry for a database service.

Example: a static database entry (use only when you have a clear requirement):

SID_LIST_LISTENER=
  (SID_LIST=
    (SID_DESC=
      (GLOBAL_DBNAME = sales.us.example.com)
      (ORACLE_HOME   = /oracle23c)
      (SID_NAME      = sales)
    )
  )

Editing tip: the most common failure is broken parenthesis nesting. If you copy/paste, re-check indentation and matching parentheses before restarting the listener.


Configuring Listener - Exercise

Click the exercise link below to add an entry for the COIN database to your listener.ora file.
Configuring Listener - Exercise
[1] listener.ora: A configuration file that defines Oracle Net Listener properties (addresses/ports, optional static services, and control parameters).

SEMrush Software 5 SEMrush Banner 5