Oracle Database 12c : Multitenant Architecture : Container or Pluggable Database CDB/PDB

Oracle_Database_MultiTenant_Architecture_PDB_CDB

With the launch of database 12c in 2013, Oracle introduced a new architectural concept called Multi-Tenancy, where you have a Container Database (CDB) and Pluggable Database (PDB).

To explain I included video from Tom Kyte & Randy Urbano where Tom discuss about Pluggable Databases and challenges in Database Consolidation. Randy explains Architecture of PDB/CDB and moves PDB from one CDB to another using SQL > ALTER PLUGGABLE DATABASE ….

https://www.youtube.com/watch?v=2MrouEW9j88

Quiz (post answer under comments) : How many PDBs can be inside a CDB (hint watch the video) ?

Before running the Installer on an Linux environment, packages (RPMs) can be installed through yum to meet all the system per-requisites:

For Oracle Linux 6 yum install oracle-rdbms-server-12cR1-preinstall

For Oracle Linux 5 – yum install oracle-validated -y

Database software Installer and DBCA are similar to 11g, except for this screen where you can pre-configure your CDB and PDBs:

23

This DBCA execution will not only create a CDB and 1 PDB, but a “seed pluggable database” as well .  You can use this seed database as a template to create other pluggable databases (PDBs).

35

By default, after running the DBCA, all CDBs and PDBs are up and running.

You must be having some basic questions after reading Oracle Database Multi-Tenancy Architecture. So here are the answers.

  • Is there a difference when starting the listener and the CDB?

No!  You can start the listener and your CDB in exactly the same way as you did with your pre-12c database.

  • How can you connect to the CDB?

Very simple: just the same as in past with pre-12c databases.

$ sqlplus system@<CDB_db_name>

SQL*Plus: Release 12.1.0.2.0 Production on Sat Feb 27 09:13:31 2016

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

Enter password:
Last Successful login time: Tue Feb 23 2016 15:18:49 +00:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

  • Are the PDBs opened by default, when starting the CDB?

No.  This can be verified by SQL from view v$pdbs:

SQL> select open_mode from v$pdbs where name='<PDB_db_name>′;

OPEN_MODE
———-
MOUNTED

The PDB is mounted; to open it, just run this command:

SQL> alter pluggable database <PDB_db_name> open read write;

Pluggable database altered.

SQL> select open_mode from v$pdbs where name='<PDB_db_name>′;

OPEN_MODE
———-
READ WRITE

Note: this must be done as “SYSDBA”.

  • How can we connect to the PDB?

There are 2 methods:

First method: connect to the CDB and then switch to the PDB by setting the container:

$ sqlplus system@<CDB_db_name>

SQL> show con_name

CON_NAME
——————————
CDB$ROOT
SQL> alter session set container=<PDB_db_name>;

Session altered.

Second method: Modify your tnsnames.ora file by adding an entry for the PDB, based on the CDB entry.

Now you can connect as usual to the PDB:

$ sqlplus system@<PDB_db_name>

As you can see, it is all quite easy.  One of the main benefits of this architecture is that you can handle every PDB as a separate database that can be upgraded or plugged/unplugged independently from other databases.

Oracle DBA 12c Interview Question

In this you will getting free Interview Question related to become DataBase Admin

Click Here to book you Subscription

This post is from our Oracle Database 12c Training where We cover Architecture, Installation, File System, Backup and Recovery and difference in 12c from previous version with Hands-On,  If interested in learning Oracle Database 12c you can Register here for Oracle Database 12c Training 

(There are limited early bird discount 50% OFF so if you are keen to learn and get trained on Oracle 12c Database as DBA then register for this course).

About the Author Nancy Kamboj

Oracle Consultant at K21 Technologies - Oracle Gold Partner specialising in Design, Implement, and Support.

Leave a Comment: