Explain multi-tenant architecture (CDB/PDB).

Explain multi-tenant architecture (CDB/PDB).

In the old days of Oracle, if you wanted ten separate databases, you had to install ten separate "engines" (instances). This meant ten sets of background processes (SGA, DBWn, LGWR) eating up your server’s RAM.

Oracle 12c, 18c, and 19c changed this forever with Multitenant Architecture. It’s the difference between owning ten separate houses and owning one apartment building with ten private units.


1. The Core Components: CDB and PDB

To understand this architecture, you have to know the two types of "containers":

A. The CDB (CDB$ROOT)

The Container Database is the "Apartment Building."

  • It owns the shared resources: the SGA (memory), the Redo Logs, and the Undo Tablespace.

  • It houses the background processes (the "Engine").

  • It contains the Root Data Dictionary, which tracks all the units inside.

B. The PDB (Pluggable Database)

The Pluggable Database is the "Individual Apartment."

  • To an application or a user, it looks like a completely independent database.

  • It contains its own User Data, its own Metadata, and its own Local Data Dictionary.

  • The Magic: You can "unplug" a PDB from one server and "plug" it into another in seconds.


2. Why is this better? (The Benefits)

Before Multitenant, DBAs spent 80% of their time doing repetitive tasks. Now, things are streamlined:

  • Resource Efficiency: You no longer waste RAM on 50 different SGAs. One large pool of memory serves all PDBs.

  • Simplified Patching: You patch the CDB (the building) once, and all PDBs (the apartments) are effectively patched.

  • Rapid Provisioning: Need a new "Test" database? You can Clone a production PDB almost instantly without taking the system offline.

  • Separation of Duties: A "Local Admin" can manage their own PDB without seeing or touching the data in any other PDB.


3. The "Seeded" PDB: PDB$SEED

Inside every CDB, there is a template called PDB$SEED. It is a read-only "blueprint." When you want to create a new database, Oracle simply copies this seed to create a fresh, clean PDB in seconds.


4. How the Data Dictionary Works

This is the most clever part of the 19c architecture. There are now two layers of metadata:

  1. CDB Dictionary: Stores information about the common users (like SYS) and the shared system files.

  2. PDB Dictionary: Stores information about that specific PDB's tables and users.

When you run a query in a PDB, Oracle virtually "stitches" these two dictionaries together so the user sees one complete picture.


5. Comparison: Non-CDB vs. CDB/PDB

FeatureOld Way (Non-CDB)New Way (Multitenant)
Background Processes1 Set per Database.1 Set for All PDBs.
Memory (SGA)Fragmented across instances.One large, efficient pool.
UpgradesOne by one (slow).One upgrade for the whole container.
PortabilityRequires Export/Import.Just Unplug/Plug.

6. Common 19c Commands

Navigating this new world requires a few new SQL commands. You start at the "Building" level and "enter" an apartment:

SQL
-- See all your PDBs
SHOW PDBS;

-- Switch from the Root to a specific PDB
ALTER SESSION SET CONTAINER = MySalesPDB;

-- Open a PDB (they often start in 'MOUNT' mode)
ALTER PLUGGABLE DATABASE MySalesPDB OPEN;

Peer Tip: In Oracle 19c, the "Non-CDB" architecture (the old way) is officially deprecated. Whether you are running one database or a hundred, Oracle now expects you to use the CDB/PDB structure. It's time to embrace the "Apartment Building" life!

Looking for servers Rental ?

Call Our Expert :


  • (call for rental enquiries)

Email us :