Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connection Issue to Container Databases (CDB) and Pluggable Databases (PDB)

JamsherFeb 24 2016 — edited Feb 27 2016

Hi Oracle Guru,

In my test environment, Created two Container Database CDB1 & CDB2 this CDB has below Pluggable Databases

CDB1 has PDB1 and PDB2

CDB2  has PDB2


Now in listener it showing as below     


Service "pdb2" has 2 instance(s).

  Instance "CDB1", status READY, has 1 handler(s) for this service...

  Instance "CDB2", status READY, has 1 handler(s) for this service...

I created below TNS Entry. Now when I am connecting using this TNS once its getting connected to CDB1 PDB2 and another time to CDB2 PDB2

PDB2 =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = source)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = PDB2)

    )

  )

[oracle@source admin]$ sqlplus system/oracle@pdb2

Connected to:

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         3 PDB2                           READ WRITE NO

[oracle@source admin]$ sqlplus system/oracle@pdb2

Connected to:

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         4 PDB2                           READ WRITE NO

How can I make sure to  connect to right PDB here in this scenario.

Thanks & Regards

Jamsher Khan

This post has been answered by JohnWatson2 on Feb 24 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2016
Added on Feb 24 2016
6 comments
2,244 views