OracleNet plays a critical role in managing Oracle databases. Understanding how to configure the listener allows for flexible and reliable management of database connections. This article thoroughly explains the fundamental workings of OracleNet, with a particular focus on the static configuration of listeners.
For more information about Oracle Net, click here.
What is OracleNet?
OracleNet (formerly SQLNet) is a protocol that enables network communication between clients and Oracle databases. Clients access the database via OracleNet.
Text Diagram:
Client
(e.g., SQL*Plus)
│
│ OracleNet (TCP/IP)
▼
Listener
│
▼
Oracle Database
What is a Listener?
The Listener monitors client connection requests and mediates connections to the database. It waits on specific ports, accepting requests and assigning them to corresponding database instances.
Overview of Listener Operation
Text Diagram:
Client
│ Connection Request
▼
Listener (Waiting on Port 1521)
│ Accept Request
▼
Assign to Instance
│ Connection Established
▼
Client ← Connected
What is Static Listener Configuration?
Listener configurations can be either static or dynamic. Static configuration ensures the listener accepts connection requests even when the database is stopped, essential for remote database startup.
Benefits of Static Configuration
- Enables remote database startup.
- Enhances manageability.
Steps for Static Configuration
Edit the listener.ora file to statically register the service name (SID) with the listener.
Example of listener.ora Configuration
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
Explanation of each parameter:
GLOBAL_DBNAME: Global database name used by clients for connection.ORACLE_HOME: Directory where Oracle database is installed.SID_NAME: Database SID.
Environment-Specific Adjustments in listener.ora
Adjust the following parameters appropriately for each environment:
HOST: Hostname or IP address accepting connections. Customize according to development, test, or production environments.PORT: Listener port number. Assign different ports for each environment to avoid conflicts.ORACLE_HOME: Path to Oracle installation, which might vary between environments.GLOBAL_DBNAMEandSID_NAME: Set according to each database environment.
How to Verify GLOBAL_DBNAME and SID
Execute the following SQL queries to verify the GLOBAL_DBNAME and SID of the database:
SQL> SELECT INSTANCE_NAME, HOST_NAME FROM V$INSTANCE;
SQL> SELECT VALUE FROM V$PARAMETER WHERE NAME = 'db_name';
SQL> SELECT VALUE FROM V$PARAMETER WHERE NAME = 'db_unique_name';
INSTANCE_NAMEcorresponds to the SID.db_nameanddb_unique_namecorrespond to GLOBAL_DBNAME.
Practical Steps for Static Configuration
① Edit listener.ora
$ vi $ORACLE_HOME/network/admin/listener.ora
Use the provided example as a reference.
② Restart or Reload Listener
$ lsnrctl stop
$ lsnrctl start
or
$ lsnrctl reload
Verify the settings have taken effect:
$ lsnrctl status
Successful configuration example:
Service "ORCL" has 1 instance(s).
Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
The UNKNOWN status indicates normal static registration, as the database instance cannot inform the listener of its operational status.
Command execution example
[oracle@orcl19c ~]$ lsnrctl stop ★listener stop
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-AUG-2025 23:28:23
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl19c)(PORT=1521)))
The command completed successfully
[oracle@orcl19c ~]$ vi $ORACLE_HOME/network/admin/listener.ora ★Create listener.ora
[oracle@orcl19c ~]$ cat $ORACLE_HOME/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orcl19c)(PORT = 1521))
)
)
[oracle@orcl19c ~]$ lsnrctl start
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-AUG-2025 22:52:29
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/orcl19c/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl19c)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl19c)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 04-AUG-2025 22:52:29
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/orcl19c/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl19c)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service... ★registered
The command completed successfully
[oracle@orcl19c ~]$
Differences Between Dynamic and Static Configuration
Listeners have two configuration methods: dynamic and static. Differences summarized in the table below:
| Configuration | Accept Connections When Database is Stopped | Service Registration | Use Case |
|---|---|---|---|
| Static | Yes | Manually via listener.ora | Remote startup |
| Dynamic | No | Automatically at database startup | Regular operations |
Dynamic configuration automatically registers service information at database startup, ideal for general operations due to lower configuration overhead. Static configuration accepts connections even when the database is stopped, ideal for remote management.
Summary
Understanding listener static configuration enables remote management of databases and increases operational flexibility. Identify scenarios where static configuration is needed and utilize it effectively.
[reference]
4.1.1 Oracle Net Listener Configuration


コメント