LLI Wiki — My Digital Knowledge Base

Oracle 12c: startup, shutdown and open modes (CDB and PDB)

STARTUP and SHUTDOWN options, ALTER DATABASE open modes and pluggable database commands in Oracle 12c, from the CDB or from a PDB.

Oracle 12c separates the instance (memory and background processes) from the database (files), and a multitenant container database (CDB) can hold pluggable databases (PDBs). The commands below start and stop the instance, change the open mode of the database, and open or close PDBs from the CDB or from inside a PDB. For reference, see when to use startup, shutdown and ALTER DATABASE in Oracle 12c.

Shutdown modes

Command Behaviour
SHUTDOWN NORMAL Waits for all connected users to disconnect
SHUTDOWN IMMEDIATE Rolls back active transactions and disconnects users, then closes the database cleanly
SHUTDOWN ABORT Stops the instance at once without a clean close; the next startup performs instance recovery

Startup modes

Command Stage reached
STARTUP NOMOUNT Instance started, no control file read
STARTUP MOUNT Control files read, database not open
STARTUP Database open

Other forms from the original note:

STARTUP RESTRICT;
STARTUP FORCE;
STARTUP OPEN RECOVER;
STARTUP OPEN ORCL PFILE=INITORCL.ORA PARALLEL;
STARTUP OPEN ORCL PFILE=INITORCL.ORA EXCLUSIVE RESTRICT;

Open modes

ALTER DATABASE MOUNT;
ALTER DATABASE OPEN;
ALTER DATABASE OPEN READ ONLY;
ALTER DATABASE OPEN READ WRITE;

Check the instance and the current container:

SELECT instance_name FROM v$instance;
SHOW con_name;

Pluggable databases

From the CDB root, open or close a PDB with:

ALTER PLUGGABLE DATABASE OPEN READ WRITE;
ALTER PLUGGABLE DATABASE OPEN READ ONLY;
ALTER PLUGGABLE DATABASE OPEN UPGRADE;
ALTER PLUGGABLE DATABASE CLOSE;

ALTER PLUGGABLE DATABASE PDB1 OPEN;

SELECT con_id, name, open_mode FROM v$pdbs;

From inside a PDB:

ALTER SESSION SET CONTAINER = PDB1;
SELECT con_id, name, open_mode FROM v$pdbs;
SHUTDOWN IMMEDIATE;
SELECT con_id, name, open_mode FROM v$pdbs;

Notes

Mastodon LLIMastodon SocialFosstodon