Autostart pluggable database when CDB starts
In this blog, We will see how to auto start the pluggable database when CDB get started.
Before Version 12.1.0.2 version We had to create the trigger to start the pdb’s automatically but starting from 12.1.0.2 there is new feature to save the state of PDB’S.
- Connect to pluggable database and start the PDB’S .
- Save the state of PDB’s
SQL> alter pluggable database PDBPRIM save state;
Pluggable database altered.
2.Verify the state
SQL> select con_name, state from dba_pdb_saved_states;
3.Discard the state
SQL> alter pluggable database PDBPRIM discard state;
For 12.1.0.1, create a trigger to startup PDBs while CBD is up running.
CREATE OR REPLACE TRIGGER opn_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE ‘ALTER PLUGGABLE DATABASE ALL OPEN’;
END opn_pdbs;
/