Dropping Pluggable Database :

We can drop the pluggable database using DROP PLUGGABLE DATABASE statement from the root container.

Let’s try dropping one pdb

Step 1: Check which pdb you want to drop

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 PDB1 			  MOUNTED
	 4 PDB2 			  READ WRITE NO
	 5 DB1				  READ WRITE NO

Step 2: Close pluggable database

SQL> alter pluggable database pdb2 close immediate;

Pluggable database altered.

Step 3: Drop pdb2

SQL> drop pluggable database pdb2;
drop pluggable database pdb2
*
ERROR at line 1:
ORA-65179: cannot keep datafiles for a pluggable database that is not unplugged

It is giving me an error. As we cannot keep datafiles when we are dropping that pdb unless we have unplugged it.

So let’s drop it using including datafiles clause.

SQL> drop pluggable database pdb2 including datafiles;

Pluggable database dropped.

SQL>

We can see here the pluggable database is dropped.

If you want to be updated with all our articles send us an Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.