User Tools

Site Tools


database:oracle:pluggable-database

Oracle 12 Pluggable database

Auto start a pluggable database when Oracle starts

export ORACLE_HOME=/path/to/db_home
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=GDB_SID - SID of the global database name to connect to the main database - CDB (not pluggable - PDB)

sqlplus / as sysdba

Next, to open a single PDB:

ALTER pluggable DATABASE PDB_NAME OPEN;

To open all PDBs:

ALTER pluggable DATABASE ALL OPEN;

To keep the PDBs opened after Oracle restart, we need to save their actual opened state:

For just one PDB:

ALTER pluggable DATABASE PDB_NAME save state;

For more PDBs:

ALTER pluggable DATABASE ALL EXCEPT PDB_NAME1, PDB_NAME2 save state;

For all PDBs:

ALTER pluggable DATABASE ALL save state;

Show all pluggable databases status

col NAME FOR a10
SELECT name, open_mode FROM v$pdbs;
 
NAME       OPEN_MODE
---------- ----------
PDB$SEED   READ ONLY
FLPDB      READ WRITE
database/oracle/pluggable-database.txt · Last modified: 2023/07/04 19:36 by 127.0.0.1