• 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. How to Create a Physical Standby from ASM Primary
  2. DDL Statement Examples in SQL
  3. How to Monitor SGA Memory on Oracle Pluggable Databases
  4. Oracle 19c New Feature – SQL_DIAGNOSE_AND_REPAIR (New Automatic Diagnostics and Repair Function)
  5. How to add and drop online redo log members and groups in Oracle
  6. How To Size UNDO Tablespace For Automatic Undo Management
  7. Oracle Database Server Architecture: Overview
  8. How to Roll Forward a standby database using RMAN incremental backup in 11g
  9. Oracle 11G RMAN – Understanding UNDO backup optimisation
  10. Oracle sql script to report the list of files stored in ASM and CURRENTLY NOT OPENED

You May Also Like

Primary Sidebar

Recent Posts

  • qemu-system-x86_64: command not found
  • timedatectl: command not found
  • mpirun.openmpi: command not found
  • startkde: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright