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!