How to Stop-Start Container and Pluggable Databases in Multitenant Architecture
Container Database (CDB)
Startup and shutdown of the container database is the same as a normal database If we are shutting down the container the pluggable associated will also be stopped.
Start with options
STARTUP [NOMOUNT | MOUNT | RESTRICT | UPGRADE | FORCE | READ ONLY]
Shutdown with options
SHUTDOWN [IMMEDIATE | ABORT]
Pluggable Database (PDB)
Pluggable databases can be started and stopped from either Container database or switching to respective pluggable database.
SQLPLUS- Connected to pluggable database
STARTUP FORCE;
STARTUP OPEN READ WRITE [RESTRICT];
STARTUP OPEN READ ONLY [RESTRICT];
STARTUP UPGRADE;
SHUTDOWN [IMMEDIATE];
SQLPLUS- Connected to pluggable database or container database
The ALTER PLUGGABLE DATABASE command can be used from the CDB or the PDB.
When connected to PDB below commands can be run
ALTER PLUGGABLE DATABASE OPEN READ WRITE [RESTRICTED] [FORCE];
ALTER PLUGGABLE DATABASE OPEN READ ONLY [RESTRICTED] [FORCE];
ALTER PLUGGABLE DATABASE OPEN UPGRADE [RESTRICTED];
ALTER PLUGGABLE DATABASE CLOSE [IMMEDIATE];
When connected to the CDB as a privileged user.
ALTER PLUGGABLE DATABASE <pdb-name> OPEN READ WRITE [RESTRICTED] [FORCE];
ALTER PLUGGABLE DATABASE <pdb-name> OPEN READ ONLY [RESTRICTED] [FORCE];
ALTER PLUGGABLE DATABASE <pdb-name> OPEN UPGRADE [RESTRICTED];
ALTER PLUGGABLE DATABASE <pdb-name> CLOSE [IMMEDIATE];
The <pdb-name> can be any of the following:
One or more PDB names, specified as a comma-separated list.
The ALL keyword to indicate all PDBs.
The ALL EXCEPT keywords, followed by one or more PDB names in a comma-separate list, to indicate a subset of PDBs.
Examples
ALTER PLUGGABLE DATABASE pdb1, pdb2, pdb3 OPEN READ ONLY FORCE;
ALTER PLUGGABLE DATABASE pdb1, pdb2, pdb3 CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE ALL OPEN;
ALTER PLUGGABLE DATABASE ALL CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE ALL EXCEPT pdb10 OPEN;
ALTER PLUGGABLE DATABASE ALL EXCEPT pdb10 CLOSE IMMEDIATE;
Post a Comment
Post a Comment