C/C++ Programming Solutions, Notes , Old Question Solutions, SLC/SEE Preparation, Loksewa preparation, PSC preparation, NTC prepartion, NEA preparation , University Board Exam, Old Question Solutions. PSC preparation for Computer Engineering, computer officer, computer Programmer level-7.
July 15, 2025
How to configure Oracle Listener Step-by-Step Guide
Oracle Listener
- A server-side
process that listens for incoming client connection requests to Oracle
databases.
- Uses
the listener.ora configuration file, typically located in:
- $ORACLE_HOME/network/admin
(Linux)
- %ORACLE_HOME%\network\admin
(Windows)
Step-by-step Listener Configuration
Create/Modify listener.ora
Configure tnsnames.ora
Start the listener (lsnrctl start)
Test connectivity using tnsping
Register services if needed (ALTER SYSTEM REGISTER)
Step1:Check if a listener is already running
lsnrctl status
- If it
says TNS-12541: TNS:no listener, no listener is running.
- Otherwise, it will display current listener status.
Step2️: Create/Modify listener.ora
cd $ORACLE_HOME/network/admin
Open listener.ora in your editor:
vi listener.ora
Add or modify:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = your-hostname-or-ip)(PORT = 1521))
(ADDRESS =
(PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
Explanation:
- PROTOCOL
= TCP: Network protocol.
- HOST:
Your server hostname or IP (localhost if local).
- PORT =
1521: Default Oracle listener port.
- PROTOCOL
= IPC: For local (inter-process) connections, including external
procedures.
Step3️:Create/Modify tnsnames.ora
(Client/Server)
In the same folder, edit tnsnames.ora:
ORCL =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = your-hostname-or-ip)(PORT = 1521))
(CONNECT_DATA =
(SERVER =
DEDICATED)
(SERVICE_NAME =
orcl)
)
)
- ORCL is
your connection alias.
- SERVICE_NAME
should match your database service name (select value from v$parameter
where name='service_names';).
Step4️: Start the Listener
lsnrctl start
Verify:
lsnrctl status
You should see your listener, hostname, and port.
Step5: Test Listener Connection
tnsping ORCL
Expected output:
scss ok (20 msec)
This confirms your listener is reachable.
Step6: Add Database to Listener (if not automatically registered)
In SQL*Plus as SYSDBA:
ALTER SYSTEM REGISTER;
This will dynamically register your database with the
listener (Dynamic Service Registration).
Verify using:
lsnrctl services
You should see your database service listed under the
listener.
Step7: Stopping the Listener
To stop:
lsnrctl stop
To restart:
lsnrctl reload
Troubleshooting Tips
✅ Ensure port 1521 is open in
your firewall.
✅
Check listener.log in $ORACLE_HOME/network/log.
✅
If TNS: no listener, ensure the listener is running.
✅
Ensure your SERVICE_NAME in tnsnames.ora matches the database service name.
✅
Use ALTER SYSTEM REGISTER if the service does not appear after starting.
Bottom of Form
Recent Posts
Very Large Scale Integration VLSI
1.1 Introduction to VLSI Very Large Scale Integration (VLSI) refers to the process of creating an integrated circuit (IC) by combining mill...
-
class and object: class: 1. a class is a way to bind data and associated function together. 2. it allows data and function...
-
Abstract data type A useful tool for specifying the logical properties of a data type is the abstract data type or ADT. Fundamentally, a d...