How to automatically start PDB Pluggable Database in Oracle 12c
PDB Pluggable Database is an important new feature of 12c, but for PDB in CDB, all PDB is not brought when CDB is started by default, in this way, we need to manually alter pluggable database all open;
[Oracle @ clouds ~] $ Sqlplus "/as sysdba"
SQL * Plus: Release 12.1.0.2.0 Production on Thursday March 31 08:52:31 2016
Copyright (c) 1982,201 4, Oracle. All rights reserved.
Connect:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0-64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
And Real Application Testing options
SQL> select open_mode from v $ database;
OPEN_MODE
--------------------
READ WRITE
SQL> alter pluggable database bidb1 open;
The plug-in database has been changed.
SQL> alter pluggable database bidb2 open;
The plug-in database has been changed.
SQL> select con_id, name, open_mode from v $ pdbs;
CON_ID NAME OPEN_MODE
--------------------------------------------------
2 PDB $ SEED READ ONLY
3 BIDB1 READ WRITE
4 BIDB2 READ WRITE
-- Or directly start all the pluggable Databases
SQL> alter pluggable database all open;
You can add a Trigger to customize the PDB OPEN
Use the SYS user to create the following trigger:
Create trigger open_all_pdbs
AFTER STARTUP
ON DATABASE
BEGIN
Execute immediate 'alter pluggable database all open ';
END open_all_pdbs;
/
In this way, after the cdb of oracle 12c database is started, the pdb will also be started automatically.