How to DROP PLUGGABLE DATABASE in Oracle 19c.
Created by :
Oracle Database
article
Programming, Software and application
35256
2020-12-02 22:58:37
Syntax
DROP PLUGGABLE DATABASE options[KEEP DATAFILES | INCLUDING DATAFILES]
Prerequisites
- You must be connected to a CDB.
- The current container must be the root,
- To specify KEEP DATAFILES (the default), the PDB you want to drop must be unplugged.
- To specify INCLUDING DATAFILES, the PDB you want to drop must be in mounted mode or it must be unplugged.
Connect as ROOT
[oracle@oradb ~]$ sqlplus /nolog SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 2 16:57:33 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. SQL> connect sys as sysdba Enter password: Connected. SQL>
At now let see, which pdb database we will drop using show commands
Show pdbs;
We see list of all pdbs
Close Database
if we want to drop PDBAPEX20, we need to close this database before drooping;
ALTER PLUGGABLE DATABASE PDBAPEX20 CLOSE;
KEEP DATAFILES
The following statement drops the PDB pdb_name and it will remain its associated data files:
DROP PLUGGABLE DATABASE PDBAPEX20 KEEP DATAFILES;
INCLUDING DATAFILES
The following statement drops the PDB pdb_name and its associated data files:
DROP PLUGGABLE DATABASE PDBAPEX20 INCLUDING DATAFILES;