ORA-65179: cannot keep datafiles for a pluggable database that is not unplugged

ORA-65179: cannot keep datafiles for a pluggable database that is not unplugged

Error:

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

Solution:

Incomplete command, so use the following syntax to drop the pluggable database from the CDBROOT. Use either of the following commands:

Check the status that database is in close state:
SQL> show pdbs;
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB4                           READ WRITE NO
         5 PDB2                           MOUNTED

--Close the database if not closed:
SQL> alter pluggable database pdb4 close;

Pluggable database altered.

-- If you want to keep the data files in OS.
SQL> drop pluggable database pdb4 keep datafiles;
Pluggable database dropped.
OR
-- If you want to delete the data files from OS.
SQL> drop pluggable database pdb4 including datafiles;
Pluggable database dropped.
This entry was posted in Oracle on by .

About SandeepSingh DBA

Hi, I am working in IT industry with having more than 10 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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