Saturday, March 29, 2014

Starting a Pluggable database in 12c

In Oracle 12c when we open a CDB (Container database), the PDBs(Pluggable Databases in the CDB) are by default in mount mode.

Solution: We either need to open the pluggable databases manually or we can create a trigger which can bring up the pluggable databases once the CDB is started.

If we want the PDBs to be opened manually issue the below command in the CDB:
alter pluggable database <pdb_name> open;

If we want the PDBs to be opened automatically, we can create a database event trigger that opens all the PDBs after STARTUP.

Create the below trigger in the CDB, which will bring up all the pluggable database when the CDB instance starts 

CREATE TRIGGER OPEN_ALL_PDBs
after startup on database
begin
execute immediate 'alter pluggable database all open';
end Open_ALL_PDBs;
/