Database 12c: Pluggable Database autostart


I’vh searched for several hours, but there is no out of the box autostart mechnism for pluggable databases. Here a simple solution with a trigger:

SQL> startup
ORACLE instance started.

Total System Global Area 1970864128 bytes
Fixed Size                  2289928 bytes
Variable Size             587206392 bytes
Database Buffers         1375731712 bytes
Redo Buffers                5636096 bytes
Database mounted.
Database opened.

SQL> set pages 32000 lines 210
SQL> select con_id,name,guid,open_mode from v$pdbs order by 1;

    CON_ID NAME                           GUID                             OPEN_MODE
---------- ------------------------------ -------------------------------- ----------
         2 PDB$SEED                       E0F388EB55323E35E0430100007FF91C READ ONLY
         3 PDB1                           E1433B62351A0F0DE0430100007F3E51 MOUNTED

SQL>

Add trigger after Database start to start all PDB’s:

SQL> 
CREATE OR REPLACE TRIGGER start_pdbs
   AFTER STARTUP ON DATABASE
BEGIN
   execute immediate 'alter pluggable database all open';
END;
  6  /

Trigger created.

SQL>

Test the autostart now.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1970864128 bytes
Fixed Size                  2289928 bytes
Variable Size             587206392 bytes
Database Buffers         1375731712 bytes
Redo Buffers                5636096 bytes
Database mounted.
Database opened.
SQL> select con_id,name,guid,open_mode from v$pdbs order by 1;

    CON_ID NAME                           GUID                             OPEN_MODE
---------- ------------------------------ -------------------------------- ----------
         2 PDB$SEED                       E0F388EB55323E35E0430100007FF91C READ ONLY
         3 PDB1                           E1433B62351A0F0DE0430100007F3E51 READ WRITE

See the advanced method also

3 thoughts on “Database 12c: Pluggable Database autostart

  1. Pingback: Автозапуск Pluggable Databases в Oracle Database 12c | Oracle Spatial, Mapviewer, Semantics и ГИС системы

  2. Pingback: Auto start pluggable databases in oracle 12c | ≺datagraphy≻

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s