Friday, September 18, 2020

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

 

SQL> alter pluggable database pdb2 close;

Pluggable database altered.

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

 

 

DROP pluggable database command only works if the database has been unplugged. Keyword KEEP DATAFILES can also be used in this case to preserve the datafiles. If we really want to drop a database that has not been unplugged, we need to close this database, and then issue drop database command with INCLUDING DATAFILES clause.

SQL> alter pluggable database pdb2 close;

 Pluggable database altered.

 SQL> drop pluggable database pdb2 including datafiles;

 Pluggable database dropped.

 SQL> select * from v$pdbs;

       CON_ID       DBID    CON_UID GUID                             NAME                           OPEN_MODE  RES OPEN_TIME                                                                   CREATE_SCN TOTAL_SIZE BLOCK_SIZE RECOVERY SNAPSHOT_PARENT_CON_ID

---------- ---------- ---------- -------------------------------- ------------------------------ ---------- --- --------------------------------------------------------------------------- ---------- ---------- ---------- -------- ----------------------

         2 4081683932 4081683932 58E4124AAF984CEBB2D69B0A98A13889 PDB$SEED                       READ ONLY  NO  13-FEB-18 09.03.10.280 AM +08:00                                               2233959

796917760       8192 ENABLED                       0

No comments:

Post a Comment

Popular Posts - All Times