Skip to main content

Containers and PDBs

When to use it

On any 12c or later database, to see whether you are in a container database and which pluggable databases are open.

Run this

Starter query written for this guide:

SHOW CON_NAME
SHOW PDBS

SELECT con_id, name, open_mode, restricted, open_time
FROM   v$pdbs
ORDER  BY con_id;

-- Move your session into one PDB
ALTER SESSION SET CONTAINER = YOUR_PDB;

For deeper checks, the reference page is pdb-multitenant-monitoring.sql (Reference › RAC and multitenant › PDB (Pluggable Database) and Multitenant Monitoring): space usage, tablespaces and PDB health in a CDB.

How to read the output

  • CDB$ROOT is the root container. Application data lives in the PDBs, not in the root.
  • PDB$SEED is a template and is always READ ONLY. That is normal.
  • Every other PDB should be READ WRITE with restricted = NO. MOUNTED means the PDB is closed and its application is down.

What to do next

  • A PDB that should be open and is MOUNTED is an incident. Escalate before you open it, because someone may have closed it on purpose.
  • Most dictionary queries in this guide show only the current container. If a result looks empty, check SHOW CON_NAME.

Risk level

READ ONLY Safe to run at any time. It only queries the data dictionary.