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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • 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. Deleting duplicate records from a table
  2. How to Connect After ORA-20 has Occurred
  3. Oracle Database – How to recover from a lost datafile with no backup
  4. What roles can be set as default for a user in Oracle Database
  5. Oracle ASM 11gR2 instance is unable to start due to missing ASM spfile
  6. ORA-01666: control file is for a standby database – failover over standby as primary
  7. Oracle RAC Interview Questions – Highly Available IP (HAIP)
  8. How to find Cluster Name and Grid Version in Oracle RAC
  9. How to start up the ASM instance when the spfile is misconstrued or lost
  10. How To Shrink A Temporary Tablespace in Oracle Database

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright