Starting up 252 PDBs automatically?

In my recent posting I have explained the startup of many PDBs at the same time.

But once you startup the container database CDB$ROOT the PDBs will stay in MOUNT status. So how do you start them during CDB$ROOT startup (or immediately afterwards) in an automatic fashion?

A startup trigger will do this job.

CREATE OR REPLACE TRIGGER startup_all_pdbs
AFTER STARTUP ON DATABASE

BEGIN

EXECUTE IMMEDIATE ‘ALTER PLUGGABLE DATABASE ALL OPEN’;

END;

/

And of course you can use the EXCEPT command option to exclude one or more PDBs from the automatic startup.

CREATE OR REPLACE TRIGGER startup_all_pdbs_except_a_few
AFTER STARTUP ON DATABASE

BEGIN
EXECUTE IMMEDIATE ‘ALTER PLUGGABLE DATABASE ALL OPEN EXCEPT PDB100, PDB101’;
END;
/

How does this work in an Oracle Real Application Clusters environment?
In an RAC environment you won’t need the startup trigger as clusterware takes over this role of ensuring the automatic startup of a PDB on designated nodes within the CDB$ROOT’s instances.

srvctl add service -db rac -service pdbrac_srv -pdb pdbrac -preferred “rac1,rac2”

A snipet from the crsctl status output will look like this:

   crsctl status resource -t
:
ora.rac.db
1    ONLINE  ONLINE   rac-server01       Open,STABLE
2    ONLINE  ONLINE   rac-server02       Open,STABLE
ora.rac.pdbrac_srv.svc
1    ONLINE  ONLINE   rac-server01       STABLE
2    ONLINE  ONLINE   rac-server02       STABLE
:

-Mike

Share this: