Monday, June 23, 2014

Oracle database 12 C Listener configuration for PDBs

Version:

Oracle DB 12C

Topic:

Configure listener for database involving PDBs

Steps:

1. Add new listener details to listener.ora file. 

Note: Make sure to add only the CDB instance in the file. That means no entries should be there in listener.ora for any of the PDBs.

I have created the file using netmgr here in the example

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.mydomain)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/121010)
      (PROGRAM = extproc)
    )
    (SID_DESC =
     (GLOBAL_DBNAME = orcl.mydomain)
      (ORACLE_HOME = /u01/app/oracle/product/121010)
      (SID_NAME = orcl)
    )
  )

My lsitener name is "LISTENER" and CDB name is orcl

2. Set "LOCAL_LISTENER" parameter in CDB. 

You can either set it to the listener name or pass the hostname:port number of listener as show below

SQL> alter system set local_listener='myhost.mydomain:1521';

System altered.

3. Register the PDB instances with listener.

SQL> alter system register;

System altered.

That is it. The CDB and all PDBs would get registered with the listener now. Confirm with lsnrctl status or services commands.

lsnrctl status LISTENER
..........
....
Service "orcl.mydomain" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "pdb1.mydomain" has 1 instance(s).
Instance "pdb1", status READY, has 1 handler(s) for this service...



No comments:

Post a Comment