Delete Pluggable Database Manually using SQL Prompt

In previous article we have seen how to clone pluggable database manually from exisiting pluggable database ( Non seed )

In this article we will see how to delete pluggable database manually using SQL Prompt.

If required keep associated datafiles, in case of future use.

Note:

  • Pluggable database should be closed before being dropped.
  • I will simulate scenario with the help of PLUGDB & NEWPDB pluggable databases.

// Ensure your pluggable database mode by issuing the following query:
SQL> select name,open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY
PLUGDB MOUNTED
NEWPDB READ WRITE

// NEWPDB pluggable database is in READ WRITE mode, issue the following to close pluggable database.
SQL> alter pluggable database newpdb close;

Pluggable database altered.

// Ensure your changes:
SQL> select name,open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY
PLUGDB MOUNTED
NEWPDB MOUNTED

// Now drop newpdb database with keeping all datafiles as follow:
SQL> drop pluggable database newpdb keep datafiles;

Pluggable database dropped.

// Ensure your changes:
SQL> select name,open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY
PLUGDB MOUNTED

 

// Now drop pluggable database including datafiles: ( It will erase everything )

SQL> drop pluggable database plugdb including datafiles;

Pluggable database dropped.

// Ensure your changes:
SQL> select name,open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY

By above methods, PLUGDB & NEWPDB pluggable databases are deleted.

***********************************************************************

Note: Please don’t hesitate to revert in case of any query OR feedback.

Thanking you.

Have a easy life ahead.

Leave a Reply