Using DBMS_PDB.RECOVER

Hi guys, just passing here to post how you should use DBMS_PDB.RECOVER in order to successfully recover your PDB description XML file if you receive the error ORA-65139: Mismatch between XML metadata file and data file <DATAFILE_PATH> .

To successfully execute this procedure, you must have the description XML file. It’s quite simple when you know exactly what to do. The confusion is that you must point all the PDB’s datafiles excluding the ones from UNDO tablespace. That’s because when you are using a Multitenant Architecture, the UNDO tablespace is used for all pluggable databases. Also, all datafiles should be separated with a comma without any spaces, so it should look like this:

BEGIN
DBMS_PDB.RECOVER(PDB_DESCR_FILE=> ‘/home/oracle/PDB01.xml’, PDB_NAME=>’PDB01′, FILENAMES=> ‘+DATA/PDB01/DATAFILE/sysaux_262_863892639,+DATA/PDB01/DATAFILE/system_261_863892625,
+DATA/PDB01/DATAFILE/users_265_863892763′);
END;
/

After that, you can just execute the statement below, if you don’t want to copy datafiles to a new location:

SQL> CREATE PLUGGABLE DATABASE PDB01 USING ‘/home/oracle/PDB01.xml’ NOCOPY TEMPFILE REUSE;

Quite easy, right?! Yes, but I took some time to use this procedure, so that’s why I’m pointing it right to you. Cya, guys!

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 )

Google+ photo

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

Connecting to %s