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?
- CDB$ROOT (Root Container)
➤ Stores Oracle-supplied metadata
➤ Manages common users (users shared across all PDBs)
➤ Does not contain user data - PDB$SEED (Seed Pluggable Database)
➤ Read-only template used to create new PDBs
➤ Cannot be modified - 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 - 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?
Component | Shared Across PDBs | PDB-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!