Serverside Configuration   «Prev  Next»

Lesson 4Configuring the Oracle Listener
ObjectiveIdentify key listener parameters and how they impact connection behavior and diagnostics.

Configuring the Oracle Listener for On-Premise and Cloud Environments

The listener.ora file is used to define static listener configurations for Oracle databases running in on-premise environments. While dynamic service registration is preferred in most modern use cases (covered in Lesson 3), understanding the structure and usage of listener.ora is essential for legacy systems, multi-version setups, and advanced tuning.

Sample listener.ora Configuration

Below is a simplified example of a listener.ora file for a host supporting two Oracle databases:

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = server01)(PORT = 1521))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = prod.example.com)
      (ORACLE_HOME = /opt/oracle/product/19c/dbhome_1)
      (SID_NAME = prod)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = dev.example.com)
      (ORACLE_HOME = /opt/oracle/product/19c/dbhome_2)
      (SID_NAME = dev)
    )
  )

TRACE_LEVEL_LISTENER = OFF
    
This example defines:
  • A TCP listening address on port 1521
  • Two database instances with distinct ORACLE_HOME paths
  • Tracing set to OFF by default (can be enabled for diagnostics)
Structure of listener.ora file
Breakdown of the listener.ora configuration: Shows how network addresses, service identifiers, and optional parameters work together in listener setup.

File Placement and Centralization Strategy

In systems where multiple Oracle versions are installed on the same host, it is best practice to centralize all network configuration files (listener.ora, tnsnames.ora, sqlnet.ora) into a single version-neutral directory.


Preferred method: Use the TNS_ADMIN environment variable to point all Oracle software to a central directory such as:
/u01/app/oracle/network_admin
	
Add the following line to the Oracle user’s shell profile (e.g., ~/.bash_profile):
export TNS_ADMIN=/u01/app/oracle/network_admin

This approach eliminates the need to maintain symbolic links across multiple ORACLE_HOME directories and ensures consistent configurations across all tools (SQL*Plus, Data Pump, etc.).

Alternate method (legacy): Use symbolic links to point each Oracle installation's default config directory to a central file:

# Centralize listener.ora and link from each Oracle home
mv $ORACLE_HOME/network/admin/listener.ora /etc/listener.ora
ln -s /etc/listener.ora $ORACLE_HOME/network/admin/listener.ora
    
While this method works, it is more error-prone and harder to maintain than using TNS_ADMIN.

Optional Parameters for Enhanced Control

The listener.ora file supports several additional parameters to fine-tune listener behavior:
  • TRACE_LEVEL_LISTENER: Enables diagnostic tracing. Set to OFF by default. Use USER or ADMIN for troubleshooting.
  • STARTUP_WAIT_TIME: Delays listener startup to allow background services to initialize. Useful in clustered environments.
  • QUEUESIZE: Defines the maximum number of concurrent connection requests that can be queued. Useful for high-volume environments.
Example of setting a queue size:

(ADDRESS = (PROTOCOL = TCP)(HOST = server01)(PORT = 1521)(QUEUESIZE = 50))
    

Modern Considerations for Cloud Environments

In Oracle Autonomous Databases and 23ai cloud environments, the listener is automatically managed by Oracle Cloud Infrastructure (OCI). Manual editing of listener.ora is not required.

  • Use the OCI Console or Terraform for connectivity setup.
  • Rely on dynamic service registration and built-in diagnostics.
  • Use lsnrctl only in advanced hybrid or debugging scenarios.

The next lesson will examine how the listener actually accepts, routes, and disconnects from client requests in real time.


SEMrush Software 4 SEMrush Banner 4