Here is a short note on how to automate the startup of PDBs after the CDB starts up in Oracle database 12c. You can start all the PDBs or selective PDBs using below steps. We will need to create a database startup trigger in order to automate the PDB startup. Follow the steps outlined below.
1. Login into the CDB as sysdba.
$ sqlplus / as sysdba
2. Create a database startup trigger to open all pluggable databases.
create or replace trigger open_all_pdbs after startup on database begin execute immediate 'alter pluggable database all open'; end; /
3. Or to selectively startup pluggable databases, use separate commands for each.
create or replace trigger open_all_pdbs after startup on database begin execute immediate 'alter pluggable database MYCDB1 open'; execute immediate 'alter pluggable database MYCDB2 open'; end; /