Professional Documents
Culture Documents
PDB State Change
PDB State Change
dbaclass.com /article/how-to-open-the-pdbs-automatically-when-cdb-restarts/
In oracle 12c , when we startup the CDB, the PDBS will be in MOUNTED stage. We need to open them manually using alter pluggable PDB
open. To make the PDBS open automatically, we can use the saved state option . This feature is available from Oracle 12.1.0.2 onwards
For more information about CDB and PDB , refer Oracle 12c multitenent architecture
DEMO:
CON_NAME
------------------------------
CDB$ROOT
SQL> startup
ORACLE instance started.
1 of 7 01-02-2022, 16:08
Firefox about:blank
We can see the PDBS are in MOUNTED stage after starting CDB. Lets open them
2 of 7 01-02-2022, 16:08
Firefox about:blank
Now use save state command to save the states, so that next time ,when container db restarts, PDBs will in READ WRITE MODE automatically.
3 of 7 01-02-2022, 16:08
Firefox about:blank
CON_NAME STATE
----------------------- --------------
NONCDB OPEN
PDB1 OPEN
PDB2 OPEN
4 of 7 01-02-2022, 16:08
Firefox about:blank
We can discard the saved state, so that next time CDB restarts, PDBs will start with MOUNT STATE only.
Lets discard state for PDB2 .
CON_NAME STATE
----------------------- --------------
NONCDB OPEN
PDB1 OPEN
PDB2 OPEN
CON_NAME STATE
----------------------- --------------
5 of 7 01-02-2022, 16:08
Firefox about:blank
NONCDB OPEN
PDB1 OPEN
SQL> startup
ORACLE instance started.
6 of 7 01-02-2022, 16:08
Firefox about:blank
We can observe that, only PDB2 started in MOUNTED stage, because we have discarded the saved state for PDB2 .
As this feature is not available in 12.1.0.1 , we can create a trigger to open the PDBs automatically, with container database startup.
SEE ALSO:
7 of 7 01-02-2022, 16:08