Skip to main content

Configure Shared Listener in Oracle Database

Oracle Shared Listener configuration with dispatcher and shared server processes

Introduction

In this article, we will see how to configure a Shared Listener in Oracle Database. It is especially beneficial in environments with many light or intermittent user connections, such as web or application servers.

Type of Server

  • Dedicated Server: Provides one server process per session, offering maximum performance and isolation but using more memory.
  • Shared Server: Allows multiple clients to share a pool of server processes, providing scalability and memory savings but introducing some queue-related latency.

Parameters

The following parameters need to be configured for a Shared Listener. All of them can be modified dynamically without bouncing the database instance.

  • DISPATCHERS: specifies one or more dispatcher processes that handle incoming client connections in a Shared Server configuration.
  • LOCAL_LISTENER: specifies how the database locates the listener running on the local machine. It ensures the instance registers properly with the listener so clients can connect using shared server, dedicated server, or both.
  • SHARED_SERVERS: specifies the minimum number of shared server processes the database instance should maintain.
  • MAX_SHARED_SERVERS: specifies the maximum number of shared server processes the database instance is allowed to spawn dynamically based on load.

Environment Used in this Guide

Hostname orcl.oraeasy.com
Database Name orcldb
Database Version 19.27
Existing Listener LISTENER (1521)
Shared Listener LISTENER_SHARED (1526)

Prerequisites

  • Use a new port for the Shared Listener, and make sure it's enabled on the server or that the firewall is disabled for it.
  • No downtime required, but a 15-minute buffer is suggested for safety.

Configuring the Shared Listener Step by Step

Step 1: Back Up Configuration Files and Check Current Listener Status

Before making any changes, take a pfile snapshot and back up the existing listener.ora and tnsnames.ora files, since editing them by hand carries no built-in undo.


Create pfile:
SQL> def DEFINE _DATE = "07-DEC-25" (CHAR) DEFINE _CONNECT_IDENTIFIER = "orcldc" (CHAR) DEFINE _USER = "SYS" (CHAR) DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR) DEFINE _SQLPLUS_RELEASE = "1927000000" (CHAR) DEFINE _EDITOR = "vi" (CHAR) DEFINE _O_VERSION = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.27.0.0.0" (CHAR) DEFINE _O_RELEASE = "1927000000" (CHAR) SQL> SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB READ WRITE NO SQL> CREATE PFILE='/home/oracle/pfileorcl.ora' FROM SPFILE; File created. Listener status & file backup:
[oracle@orcl ~]$ lsnrctl status LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 07-DEC-2025 15:30:47 Copyright (c) 1991, 2025, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.oraeasy.com)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 07-DEC-2025 11:32:03 Uptime 0 days 3 hr. 58 min. 45 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/orcl/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.oraeasy.com)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "2c3d6bacf692345be0633350a8c050ed" has 1 instance(s). Instance "orcldc", status READY, has 1 handler(s) for this service... Service "ORCLDC" has 1 instance(s). Instance "orcldc", status READY, has 1 handler(s) for this service... Service "orcldcXDB" has 1 instance(s). Instance "orcldc", status READY, has 1 handler(s) for this service... Service "orclpdb" has 1 instance(s). Instance "orcldc", status READY, has 1 handler(s) for this service... The command completed successfully [oracle@orcl ~]$ [oracle@orcl ~]$ ps -ef|grep tns root 6 2 0 11:30 ? 00:00:00 [netns] oracle 3618 1 0 11:32 ? 00:00:00 /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr LISTENER -inherit oracle 14881 7297 0 15:31 pts/1 00:00:00 grep --color=auto tns [oracle@orcl ~]$ [oracle@orcl ~]$ cd $ORACLE_HOME/network/admin [oracle@orcl admin]$ [oracle@orcl admin]$ ls listener.ora samples shrept.lst sqlnet25012210AM4609.bak sqlnet.ora tnsnames.ora [oracle@orcl admin]$ cp listener.ora listener_bkp.ora [oracle@orcl admin]$ cp tnsnames.ora tnsnames_bkp.ora

The existing LISTENER on port 1521 confirms the baseline configuration before any shared listener changes are introduced.

Step 2: Edit the Listener and TNS Files for the Shared Listener

Add a new LISTENER_SHARED entry to listener.ora on a separate port, plus matching TNS aliases in tnsnames.ora that specify SERVER=SHARED. This is what actually routes a connection through the shared server pool instead of a dedicated process.


[oracle@orcl admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.oraeasy.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

##### Shared Listener #####
LISTENER_SHARED = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.oraeasy.com)(PORT = 1526)) ) ) [oracle@orcl admin]$ [oracle@orcl admin]$ cat tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. ORCLPDB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.oraeasy.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orclpdb) ) ) ORCLDC = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.oraeasy.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcldc) ) ) ##### Shared Listener #####
ORCLDCSH = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.oraeasy.com)(PORT = 1526)) ) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = orcldc) ) ) ORCLPDBSH = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.oraeasy.com)(PORT = 1526)) ) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = orclpdb) ) ) [oracle@orcl admin]$

Step 3: Start the Shared Listener

With the listener entry in place, start it independently of the existing dedicated listener.


[oracle@orcl admin]$ lsnrctl start LISTENER_SHARED

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 07-DEC-2025 15:59:26

Copyright (c) 1991, 2025, 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/orcl/listener_shared/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.oraeasy.com)(PORT=1526)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.oraeasy.com)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SHARED
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                07-DEC-2025 15:59:27
Uptime                    0 days 0 hr. 0 min. 1 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/orcl/listener_shared/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.oraeasy.com)(PORT=1526)))
The listener supports no services
The command completed successfully

[oracle@orcl admin]$ ps -ef|grep tns
root           6       2  0 11:30 ?        00:00:00 [netns]
oracle      3618       1  0 11:32 ?        00:00:00 /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr LISTENER -inherit
oracle     15794       1  0 15:59 ?        00:00:00 /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr LISTENER_SHARED -inherit
oracle     15802    7297  0 16:00 pts/1    00:00:00 grep --color=auto tns
[oracle@orcl admin]$

"The listener supports no services" here is expected at this point — the database instance hasn't registered with it yet. That gets resolved once LOCAL_LISTENER is updated in the next step.

Step 4: Edit the Local Listener, Dispatcher, and Shared Server Parameters

Update LOCAL_LISTENER so the instance registers with both listeners, then configure DISPATCHERS, SHARED_SERVERS, and MAX_SHARED_SERVERS to actually enable shared server mode. All of these can be changed dynamically without bouncing the instance.



SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB                        READ WRITE NO
SQL>
SQL> show parameter local

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string
parallel_force_local                 boolean     FALSE
SQL>
SQL> alter system set local_listener='(address=(protocol=tcp)(host=orcl.oraeasy.com)(port=1526))','(address=(protocol=tcp)(host=orcl.oraeasy.com)(port=1521))';

System altered.

SQL> show parameter local

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string      (address=(protocol=tcp)(host=o
                                                 rcl.oraeasy.com)(port=1526)),
                                                 (address=(protocol=tcp)(host=o
                                                 rcl.oraeasy.com)(port=1521))
parallel_force_local                 boolean     FALSE
SQL>

SQL> show parameter shared_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers                   integer
shared_servers                       integer     1
SQL>
SQL> show parameter max_shared_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers                   integer

SQL> show parameter DISPATCHERS

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dispatchers                          string      (PROTOCOL=TCP) (SERVICE=orcldc
                                                 XDB)
max_dispatchers                      integer
SQL>
SQL> ALTER SYSTEM SET DISPATCHERS='(ADDRESS=(PROTOCOL=TCP)(DISPATCHERS=25))';

System altered.

SQL> ALTER SYSTEM SET SHARED_SERVERS = 50;

System altered.

SQL> alter system set max_shared_servers=100;

System altered.

SQL> show parameter shared_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers                   integer
shared_servers                       integer     50
SQL>
SQL> show parameter DISPATCHERS

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dispatchers                          string      (PROTOCOL=TCP) (SERVICE=orcldc
                                                 XDB), (ADDRESS=(PROTOCOL=TCP)(
                                                 DISPATCHERS=25))
max_dispatchers                      integer
SQL>
SQL> show parameter max_shared_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers                   integer     100

SQL> alter session set container=ORCLPDB;

Session altered.

SQL> show parameter local

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string      (address=(protocol=tcp)(host=o
                                                 rcl.oraeasy.com)(port=1526)),
                                                 (address=(protocol=tcp)(host=o
                                                 rcl.oraeasy.com)(port=1521))
parallel_force_local                 boolean     FALSE
SQL>
SQL> show parameter shared_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers                   integer
shared_servers                       integer     50
SQL>
SQL> show parameter DISPATCHERS

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dispatchers                          string      (PROTOCOL=TCP) (SERVICE=orcldc
                                                 XDB), (ADDRESS=(PROTOCOL=TCP)(
                                                 DISPATCHERS=25))
max_dispatchers                      integer
SQL>
SQL> show parameter max_shared_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers                   integer     100

Confirming these parameters in both the CDB root and the PDB matters, since LOCAL_LISTENER and the shared server parameters need to be consistent across containers for shared connections to work correctly inside the PDB.

Step 5: Check Listener Status and Test with tnsping

With registration complete, confirm both listeners now show the expected services, then verify each shared TNS alias resolves correctly before attempting an actual connection.


[oracle@orcl admin]$ lsnrctl status LISTENER_SHARED

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 07-DEC-2025 16:14:27

Copyright (c) 1991, 2025, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.oraeasy.com)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SHARED
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                07-DEC-2025 15:59:27
Uptime                    0 days 0 hr. 15 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/orcl/listener_shared/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.oraeasy.com)(PORT=1526)))
Services Summary...
Service "2c3d6bacf692345be0633350a8c050ed" has 1 instance(s).
  Instance "orcldc", status READY, has 1 handler(s) for this service...
Service "ORCLDC" has 1 instance(s).
  Instance "orcldc", status READY, has 1 handler(s) for this service...
Service "orcldcXDB" has 1 instance(s).
  Instance "orcldc", status READY, has 1 handler(s) for this service...
Service "orclpdb" has 1 instance(s).
  Instance "orcldc", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@orcl admin]$
[oracle@orcl admin]$ lsnrctl status LISTENER

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 07-DEC-2025 16:14:33

Copyright (c) 1991, 2025, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl.oraeasy.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                07-DEC-2025 11:32:03
Uptime                    0 days 4 hr. 42 min. 30 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/orcl/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl.oraeasy.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "2c3d6bacf692345be0633350a8c050ed" has 1 instance(s).
  Instance "orcldc", status READY, has 1 handler(s) for this service...
Service "ORCLDC" has 1 instance(s).
  Instance "orcldc", status READY, has 1 handler(s) for this service...
Service "orcldcXDB" has 1 instance(s).
  Instance "orcldc", status READY, has 1 handler(s) for this service...
Service "orclpdb" has 1 instance(s).
  Instance "orcldc", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@orcl admin]$
[oracle@orcl admin]$ tnsping ORCLDCSH

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 07-DEC-2025 16:04:12

Copyright (c) 1997, 2025, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.oraeasy.com)(PORT = 1526))) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = orcldc)))
OK (10 msec)
[oracle@orcl admin]$
[oracle@orcl admin]$ tnsping ORCLPDBSH

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 07-DEC-2025 16:04:21

Copyright (c) 1997, 2025, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl.oraeasy.com)(PORT = 1526))) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = orclpdb)))
OK (0 msec)
[oracle@orcl admin]$


Both tnsping calls returning OK confirm the shared TNS aliases are correctly resolving to the new listener on port 1526.

Step 6: Connect Using Both Shared and Dedicated TNS Aliases

Open separate terminals and test connections through all four aliases: the original dedicated aliases and the new shared ones, to confirm both paths work side by side.


[oracle@orcl ~]$ sqlplus sys@ORCLDC as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 7 16:15:08 2025
Version 19.27.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0


[oracle@orcl ~]$ sqlplus sys@ORCLPDB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 7 16:15:30 2025
Version 19.27.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

[oracle@orcl ~]$ sqlplus sys@ORCLDCSH as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 7 16:30:20 2025
Version 19.27.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

[oracle@orcl ~]$ sqlplus sys@ORCLPDBSH as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Dec 7 16:30:27 2025
Version 19.27.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

Step 7: Confirm Whether Each Connection Is Shared or Dedicated

Finally, confirm at the session level which connections actually went through the shared server pool versus a dedicated process.


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB                        READ WRITE NO

SQL> col username for a5
SQL> col SERVICE_NAME for a15
SQL> select username,sid,PROGRAM, SERVICE_NAME, SERVER FROM V$SESSION where username is not null;

USERN        SID PROGRAM                                          SERVICE_NAME    SERVER
----- ---------- ------------------------------------------------ --------------- ---------
SYS            6 oracle@orcl.oraeasy.com (OFSD)                   SYS$BACKGROUND  DEDICATED
SYS           62 sqlplus@orcl.oraeasy.com (TNS V1-V3)             ORCLDC          SHARED
SYS           68 sqlplus@orcl.oraeasy.com (TNS V1-V3)             orclpdb         SHARED
SYS           78 sqlplus@orcl.oraeasy.com (TNS V1-V3)             orclpdb         DEDICATED
SYS          288 sqlplus@orcl.oraeasy.com (TNS V1-V3)             SYS$USERS       DEDICATED
SYS          309 sqlplus@orcl.oraeasy.com (TNS V1-V3)             ORCLDC          DEDICATED

The SERVER column showing a mix of SHARED and DEDICATED sessions confirms both listener paths are functioning simultaneously against the same instance.



Thank you for reading!

I hope this content has been helpful to you. Your feedback and suggestions are always welcome. Feel free to leave a comment or reach out with any queries.

Abhishek Shrivastava

Oracle DBA with hands-on experience managing production Data Guard, RAC, GoldenGate, and APEX environments. I write practical, tested installation and troubleshooting guides based on real deployment work.

📧 Email: oraeasyy@gmail.com
🌐 Website: www.oraeasy.com

Follow Us

Comments