apps-dba journal

A working journal for Oracle DBAs.

September 19, 2026

Oracle DBA Lesson 5A — CDB Anatomy

Oracle DBA · Lesson 5A

CDB Anatomy

Root, seed, and application PDBs sit inside one CDB. Know which container you are in before you create users or objects.

AI Ops Pro channel

Watch on YouTube

Oracle DBA Lesson 5A — CDB Anatomy

AI Ops Pro

Why anatomy matters

Create a user in the wrong container and you either pollute the root or invent an account the application PDB cannot see. Knowing the pieces is a safety skill.

CDB$ROOT

CDB$ROOT holds Oracle-supplied metadata and common users. It is also where you start and stop the instance for the whole CDB.

Root-level admin is for the database as a whole — not for application tables.

PDB$SEED

PDB$SEED is a read-only template. New empty PDBs are cloned from it.

Do not put application data in the seed. It is a create template, not storage for apps.

User PDBs

Application databases live in user-created PDBs. Each keeps its own SYSTEM and SYSAUX (and usually its own undo and temp).

That is where local users, tablespaces, and application objects belong.

System container

The system container means the root plus every PDB — the whole CDB as one idea. It is not another PDB.

You may also hear about application containers (an application root plus application PDBs that share an application definition). Useful for SaaS-style tenancy; this lesson only flags the idea.

Physical reality and sessions

Control files and redo are still shared across the CDB. Data files belong to a specific container.

Your session is always in one container. Switch with ALTER SESSION SET CONTAINER or connect to a PDB service. Some work is root-only (startup, common users); some is PDB-local (app tablespaces, local users).

Commands to try

SELECT con_id, name, open_mode
FROM   v$containers
ORDER  BY con_id;

Lists every container this instance knows — root, seed, and user PDBs — with open mode.

ALTER SESSION SET CONTAINER = pdb1;
SHOW CON_NAME;

Moves the session into a named PDB, then confirms the current container name.

SELECT con_id, file_name
FROM   cdb_data_files
ORDER  BY con_id, file_name;

Shows data files tagged by container — proof that files belong to a specific PDB or root.

Gotchas

  • Do not store application objects in PDB$SEED — clone from it instead.
  • The system container is root + all PDBs, not a separate PDB you open.
  • Local app users belong in the application PDB, not in root.
  • Always confirm the current container before DDL or user changes.

Quick quiz

Choose one answer per question, then submit. You’ll see the correct answer and a short why.

1. What is PDB$SEED for?

2. What does the system container mean?

3. You need a local app user for the SALES application. Where do you create it?

4. You need a brand-new empty PDB for a project. What should you do?

No comments:

Post a Comment

Oracle DBA Lesson 14B — Recognize an In-Doubt Distributed Transaction

Oracle DBA · Lesson 14B Oracle DBA Lesson 14B — Recognize an In-Doubt Distributed Transaction A change that spans databases must...