So my very last entry in my Pythian blog, before I joined Oracle, I talked about what happens if you try to recover a PLUGGABLE DATABASE if you do a DROP PLUGGABLE DATABASE in 12cR1, long story short (Also a joke if you watch South Park), you are not going to be able to restore/recover your database. Now I will dig a bit deeper into why and about what happens in the control file, and why you need to restore the control file so that you can recover your pluggable database.
If I create a Database called TESTDB
If I do a dump of the control file type 4, which it includes , file header, the database info record, and checkpoint progress records,the earliest and latest records for circular reuse record types and the the 4 most recent records for circular reuse record types.
I can see in the dump of the control file that the pluggable database has a “id” of 4 and a “Record id” of 4, which are not the same, as one is the PDB_ID and the other is the Control File Record ID, as you can see below :
Now if we see a little bit down below in the file, which I will trim for this exercise to just show the datafile 12, we can see that there is a relationship between this id, and the datafiles for this pluggable database.
What I proceed to do now, is drop the pluggable database
And now doing another dump of my control file, I can see that the ID from dump of the controlfile is 0 and the Record ID is still 4, and now the relationship between the datafiles, which is not lost, is still number 4, which means that is not related to id number 0, so basically there are no datafiles related to this PDB, which my logic tells me that it is what I want, as I just dropped my PDB.
Now, I don’t know what it takes for the PDB_ID=0 to be removed from the controlfile, but if I go ahead and create another pluggable database, I can see from the dump that the record for that DB(TESTDB) is now deleted,the new DB grabs the PDB record ID of 4 and Controlfile Record of 4 , and now there is actually no record that it even existed, making it impossible for RMAN to recover/restore your database with the record being 0 or if the pluggable database not existing in the PLUGGABLE DATABASE RECORDS section.
This is just to give you and idea of what happens in the control file when you issue DROP PLUGGABLE DATABASE, which is where the registry of your PDBs/Datafiles and Backups are kept, which is why when you issue that command , the only way to restore/recover your PDB is to restore the controlfile, root and PDB, this can be done in an auxilary database, if you do need to do it.