Oracle 12c: AFTER STARTUP trigger to open PDBs

Update: Starting with Oracle 12.1.0.2, it is possible to save a PDB state so this workaround is no longer necessary.

When starting up an Oracle 12c database with pluggable databases, the pluggable databases in a container database are not automatically opened, just placed in MOUNT mode. This can be a problem in some cases.

To automatically open the pluggable databases on startup, you’ll have to create an AFTER STARTUP trigger in the CDB. For my own reference, I will post such a trigger here:

CREATE TRIGGER open_all_pdbs
AFTER STARTUP ON DATABASE
BEGIN
     EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
END open_all_pdbs;
/

Comments

Oh no, new comments are currently disabled.
If you want to get in touch with me, please do so via e-mail:

Oracle 12c: Show PDB saved state – Simon Krenger, on 2015-02-17 11:01:13 (Website)

[…] think this is one of the more awesome improvements in 12.1.0.2, since the original startup trigger was more of a workaround than a real […]