12c Containers

Working with PDBs

Set your ORACLE_SID and log into the CDB instance using normal oraenv and sqlplus "/ as sysdba" method.

Is current DB a CDB?

SQL> select cdb from v$database;
 
CDB
---
YES

View available PDBs

SELECT name, open_mode FROM v$pdbs;

Startup a PDB, persist open state when CDB opens

ALTER PLUGGABLE DATABASE PDB_NAME OPEN;
SELECT name, open_mode FROM v$pdbs;
ALTER PLUGGABLE DATABASE PDB SAVE STATE;

Switch Container Databases

ALTER SESSION SET CONTAINER=CDB$ROOT;
SHOW CON_NAME

ALTER SESSION SET CONTAINER=PDB_NAME;
SHOW CON_NAME

References

Viewing Information About CDBs and PDBs with SQL*Plus