Register Oracle service name on Listener other than 1521

While the default port number of the Oracle LISTENER 1521, then the Oracle database will register the services names within the Listener, but when we change the port number or adding an other listener, we have to manage this by configuring the initialization parameter “local_listener”, in my case there are an other Listener 1551.

Steps:

  1. Check the Listener creation
  2. Start the Listener with the port 1551
  3. Create a tns names entry.
  4. Configure the parameter local_listener
  5. Check the Listener status

Step 1: Check the Listener creation:

[oracle@db12cr2 ~]$ cat /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
LISTENER51 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1551))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1551))
)
)

Step 2: Start the Listener with the port 1551:

$ lsnrctl status  LISTENER51
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 17-OCT-2020 10:57:28
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1551)))
STATUS of the LISTENER
Alias LISTENER51
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 17-OCT-2020 10:56:30
Uptime 0 days 0 hr. 0 min. 57 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/db12cr2/listener51/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db12cr2.wadhahdaouehi.tn)(PORT=1551)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1551)))
The listener supports no services
The command completed successfully

Step 3: Create a tns names entry:

[oracle@db12cr2 ~]$ cat /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
LISTENER_ORCL51 =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1551))

Step 4: Configure the parameter local_listener

SQL> show parameter local
NAME TYPE VALUE

local_listener string LISTENER_ORCL
parallel_force_local boolean FALSE
SQL> alter system set local_listener='LISTENER_ORCL','LISTENER_ORCL51' scope=both;
System altered.
SQL>

Step 5: Check the Listener status:

[oracle@db12cr2 ~]$ lsnrctl status  LISTENER51
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 17-OCT-2020 10:58:04
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1551)))
STATUS of the LISTENER
Alias LISTENER51
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 17-OCT-2020 10:56:30
Uptime 0 days 0 hr. 1 min. 33 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/db12cr2/listener51/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db12cr2.wadhahdaouehi.tn)(PORT=1551)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1551)))
Services Summary…
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service…
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service…
The command completed successfully

Enjoy!

Bookmark the permalink.
Loading Facebook Comments ...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.