| Lesson 4 | Configuring the Oracle Listener |
| Objective | Identify key listener parameters and how they impact connection behavior and diagnostics. |
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.
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:
OFF by default (can be enabled for diagnostics)
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.
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.).
# 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.
listener.ora file supports several additional parameters to fine-tune listener behavior:
OFF by default. Use USER or ADMIN for troubleshooting.
(ADDRESS = (PROTOCOL = TCP)(HOST = server01)(PORT = 1521)(QUEUESIZE = 50))
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.
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.