Container Database (CDB)

Multitenant Container Database (CDB)

🧠 Introduction
What is a Container Database (CDB)?
Think of it like a hotel 🏨:

  • The hotel building is the CDB
  • Each hotel room is a Pluggable Database (PDB)
  • Guests (apps/users) stay in the rooms (PDBs), not in the lobby (root)

Let’s break it down!

🧩 What Is a CDB?
A CDB (Container Database) is an Oracle database that includes multiple separate databases inside it, called PDBs (Pluggable Databases).

Each PDB contains schemas, tables, indexes, and application-specific data.

πŸ“Œ From an app or user perspective:
➀ The PDB looks and behaves like a standalone database.

πŸ“Œ From the operating system or Oracle perspective:
➀ The CDB is the actual database instance running on disk.

🧠 What Containers Exist in a CDB?

  1. CDB$ROOT (Root Container)
    ➀ Stores Oracle-supplied metadata
    ➀ Manages common users (users shared across all PDBs)
    ➀ Does not contain user data
  2. PDB$SEED (Seed Pluggable Database)
    ➀ Read-only template used to create new PDBs
    ➀ Cannot be modified
  3. User-Created PDBs (Pluggable Databases)
    ➀ Created by DBAs to run applications
    ➀ Each PDB is logically isolated
    ➀ You can plug multiple PDBs into a CDB
    ➀ But a PDB can’t be plugged into multiple CDBs
  4. Application Containers (Optional)
    ➀ Group of PDBs that share application data and metadata
    ➀ Helps build and manage complex multi-tenant applications
    ➀ Think of it like a sub-hotel within your main hotel

🧱 What’s Shared and What’s Not?

ComponentShared Across PDBsPDB-Specific
Control Fileβœ… Yes❌ No
Redo Log Filesβœ… Yes❌ No
Data Files❌ Noβœ… Each container
Tablespaces❌ Noβœ… Each container
Metadata (Root)βœ… Common Users❌ No User Data

πŸ“ Each container has its own data files and tablespaces, but control files and redo logs are shared by the whole CDB.

πŸ“Œ Important Note
Oracle has desupported Non-CDB architecture in Oracle Database 21c.

➀ You can no longer create non-CDB instances using tools like:

  • Oracle Universal Installer
  • DBCA (Database Configuration Assistant)

The Multitenant Architecture is now mandatory β€” and honestly, it’s way more flexible and scalable.

πŸ› οΈ DBA Tip of the Day
The CDB/PDB model is your go-to for modern Oracle deployments.

βœ”οΈ Use it to consolidate multiple apps
βœ”οΈ Securely isolate environments
βœ”οΈ Clone PDBs quickly for dev/test
βœ”οΈ Simplify upgrades and patching

If you’re still thinking in terms of one database = one app, it’s time to think multitenant!