Oracle Database basics: instance vs database, CDB and PDB
An Oracle instance is memory and processes; the database is the files on disk. Since 21c every database is a container database (CDB) that holds pluggable databases (PDBs).
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
Oracle uses two words that other databases blur together. Getting them straight makes the rest of Oracle administration much easier to follow.
Instance vs database
- The database instance is a set of memory structures and processes. When it starts, Oracle allocates the System Global Area (SGA), a shared memory area, and starts background processes. The instance does the work.
- The database is the set of files on disk: data files, control files and online redo log files. It holds the data.
In a single-instance setup there is one instance per database. With Oracle Real Application Clusters (RAC) several instances on different servers open the same database. An instance mounts only one database at a time. On a host, each instance is identified by its SID, usually set with the ORACLE_SID environment variable, alongside ORACLE_HOME (where the software is installed).
Startup stages
Starting a database goes through three states, which matter for maintenance and recovery:
- NOMOUNT: the instance is started (parameter file read, SGA allocated, background processes running) but not attached to a database. Used when creating a database or restoring control files.
- MOUNT: the instance has read the control file and knows the database’s files, but users cannot connect. Used for full restores and for switching on ARCHIVELOG mode.
- OPEN: data files are open and authorized users can work.
export ORACLE_SID=ORCLCDB
sqlplus / as sysdba
SQL> STARTUP -- goes through NOMOUNT, MOUNT and OPEN
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP MOUNT -- stop at MOUNT for maintenance
SQL> ALTER DATABASE OPEN;
Multitenant: CDB and PDB
Since Oracle Database 12c, a database can be a multitenant container database (CDB). Starting with Oracle Database 21c it is the only supported architecture; the classic non-CDB is desupported. So in 21c and newer releases (and in most new 19c installations) you work with these containers:
- CDB$ROOT, the root: Oracle-supplied metadata and common users. It does not store user data.
- PDB$SEED, the seed: a read-only template used to create new PDBs.
- PDBs, pluggable databases: your application databases. To a client, each PDB looks like a separate database with its own service name, users, tablespaces and data.
All PDBs in a CDB share the CDB’s instance (memory and background processes) and its redo logs. That is the point of the design: many application databases, one set of processes to run and patch. You can unplug a PDB and plug it into another CDB.
Finding out where you are
SHOW CON_NAME
SELECT SYS_CONTEXT('USERENV', 'CON_NAME') FROM dual;
SELECT name, open_mode FROM v$pdbs;
ALTER SESSION SET CONTAINER = orclpdb1; -- switch, as a common user with SET CONTAINER
When you run sqlplus / as sysdba on the server, you land in CDB$ROOT. Applications should connect straight to their PDB through its service name instead (see the article on connecting to Oracle).
Common users and local users
- A common user exists in the root and in every PDB. Its name must start with the common user prefix, by default
C##(for exampleC##DBA).SYSandSYSTEMare Oracle-supplied common users. - A local user exists in one PDB only and must not start with
C##. Application schemas should be local users created while connected to the PDB.
A frequent beginner error is trying CREATE USER appuser ... while connected to the root; Oracle refuses because the name lacks the common prefix. Switch to the PDB first.
Version names
Oracle Database 19c is the long-term support release found in most data centers. 21c was an innovation release. 23ai followed, and the current documentation set is published for the release now named 26ai. Statements on this page about CDB/PDB apply from 12c on, and the non-CDB desupport applies from 21c on.
Official documentation
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0222 Connecting to Oracle: SQL*Plus, SQLcl, EZConnect, tnsnames.ora and the listener Clients reach an Oracle database through the listener, using an Easy Connect string or a tnsnames.ora alias. Here are the formats, the… Intermediate · Cheat sheet · Linux, macOS, Windows Article Administration · Concepts & tools 15 Oct 2026
- 0226 Fix: ORA-12541: TNS:no listener The client reached the host but nothing was listening on that port. Start or fix the Oracle listener, or correct the host… Intermediate · Fixes an error · Linux, Windows Article Administration · Concepts & tools 15 Oct 2026
Repos in the wild
- Oracle docker-images: Oracle Database containers oracle/docker-images Oracle's official collection of container build files and examples for its products, including Dockerfiles and a build script for Oracle Database single-instance images. GitHub
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +4,038 chars