Showing posts with label Configure Oracle 19c Listener Step-by-Step. Show all posts
Showing posts with label Configure Oracle 19c Listener Step-by-Step. Show all posts

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...