• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Define PDB Listeners With Different Ports In a Oracle database Multitenant Setup

By admin

This post will discuss the necessary steps to create and configure listeners for a Pluggable Database (PDB) in a Multitenant environment.

1. Using netca create a 2nd listener on a unique port. This creates a listener.ora file in the $ORACLE_HOME/network/admin directory similar to:

$ cat $ORACLE_HOME/network/admin/listener.ora
PDB_LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = test))
      (ADDRESS = (PROTOCOL = TCP)(HOST = host.us.oracle.com)(PORT = 1524))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1524))
    )
  )

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_PDB_LISTENER=ON                 # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_PDB_LISTENER=SUBNET           # line added by Agent

2. Within the PDB issue the following statement:

SQL> alter system set listener_networks='(( NAME=net1)(LOCAL_LISTENER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host.us.oracle.com)(PORT=1524)))))' scope=spfile;

Here,
– use scope=memory for testing only.
– LOCAL_LISTENER and REMOTE_LISTENER parameters are not PDB modifiable.

3. modify the PDB service definition in tnsnames.ora to point to the correct port

$ vi $ORACLE_HOME/network/admin/tnsnames.ora
PDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = host.us.oracle.com)(PORT = 1524))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pdb1)
    )
  )

4. The LREG process will automatically register the service with the listener after executing the command from step 2. Connections and lsnrctl service/status pdb_listener output are all correct for the connection.

$ lsnrctl service pdb_listener

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 01-DEC-2014 13:18:01

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=test)))
Services Summary...
Service "pdb1" has 1 instance(s).
  Instance "CDB1", status READY, has 2 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER 
         (ADDRESS=(PROTOCOL=tcp)(HOST=host.us.oracle.com)(PORT=24804))
      "DEDICATED" established:2 refused:0 state:ready
         LOCAL SERVER
The command completed successfully
$ lsnrctl status pdb_listener

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 01-DEC-2014 13:27:59

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=test)))
STATUS of the LISTENER
------------------------
Alias                     PDB_LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                01-DEC-2014 12:41:36
Uptime                    0 days 0 hr. 46 min. 24 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0.2/dbhome/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/host/pdb_listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=test)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host.us.oracle.com)(PORT=1524)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1524)))
Services Summary...
Service "pdb1" has 1 instance(s).
  Instance "CDB1", status READY, has 2 handler(s) for this service...
The command completed successfully

Filed Under: oracle, oracle 12c

Some more articles you might also be interested in …

  1. Understanding Flashback Table Feature in Oracle Database
  2. How to Disable Oracle Net Tracing on a Server Process without Stopping the Process
  3. Oracle Database 18c : How to Merge Partitions And Subpartitions Online
  4. Interview Questions : Oracle 12c Multitenant Database Architecture
  5. RMAN Restore/Duplicate Performs Implicit Crosschecking and Cataloging
  6. How to monitor Undo Tablespace Usage and the Free Space in Oracle Database
  7. Threaded_execution=true Prevents OS Login As Sysdba in Oracle Database 12c
  8. Oracle Database : What Is The Search Order For The LDAP.ORA File
  9. Script To Find Redolog Switch History And Find Archivelog Size For Each Instances In Oracle RAC
  10. How to move or rename a datafile in the same ASM diskgroup (Using ASM alias)

You May Also Like

Primary Sidebar

Recent Posts

  • How to set the default character set in MySQL and how to propagate it in a master-master replication scenario
  • “Connection reset by peer” – error while ssh into a CentOS/RHEL system with a specific user only
  • MySQL: how to figure out which session holds which table level or global read locks
  • Recommended Configuration of the MySQL Performance Schema
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary