Loading...

Drop pluggable databases in Oracle DB

Why use PDBs? In a multitenant environment, each customer has their own PDB which is isolated from other customers’ PDBs. A clean (domain) separation. This post covers how to get rid of one. A quick example how to drop PDBs (pluggable databases) in the multi-database architecture of Oracle DB (since v12c).

When you drop a PDB, the control file of the multitenant container database (CDB) is modified to remove all references to the dropped PDB and its data files. Archived logs and backups associated with the dropped PDB are not deleted.

DROP PLUGGABLE DATABASE

SQL> DROP PLUGGABLE DATABASE fraud INCLUDING DATAFILES
*
FEHLER in Zeile 1:
ORA-65025: Integrierbare Datenbank FRAUD ist nicht auf allen Instanzen
geschlossen.

Close the pdb to resolve ORA-65025.

SQL> ALTER PLUGGABLE DATABASE fraud CLOSE;
Integrierbare Datenbank geΣndert.

After this the drop works.

SQL> DROP PLUGGABLE DATABASE fraud INCLUDING DATAFILES;
Integrierbare Datenbank gel÷scht.