Monday, January 19, 2015

ORA-65139: Mismatch between XML metadata file and data file

While converting a non-CDB database to a PDB database, sometimes I was able to do this, but sometimes I was facing the following error.

################################
SQL> create  pluggable database pdb2 using '/u01/oracle/noncdb.xml';
create  pluggable database pdb2 using '/u01/oracle/noncdb.xml'
*
ERROR at line 1:
ORA-65139: Mismatch between XML metadata file and data file
+DATA/NONCDB/DATAFILE/system.279.868463067 for value of fcpsb (1618349 in the
plug XML file, 1619859 in the data file) 
################################

After a long of investigation, I realized that I need to strictly follow the proper steps to convert a non-CDB database to a PDB database. Steps are as follows
  1. Shutdown non-cdb database
  2. Startup non-cdb in read-only mode
  3. Execute DBMS_PDB.DESCRIBE to describe the non-cdb database in .xml file
  4. Connect to CDB and create PDB out using xml file created above
  5. Execute noncdb_to_pdb.sql script
The reason of facing this error is either or both of the following mistakes
  1. If you don’t start non-CDB database in read-only mode while describing it in the xml file, you will face this error; while creating the PDB using this xml file.
  2. After you described the non-CDB database in the xml file, you SHOULD NOT open the non-CDB database until you are finished executing your “CREATE PLUGGABLE DATABASE” command using this xml file, to create your PDB.
If you have made either or both of the above mistakes, you should perform all the steps again following correct sequence

No comments:

Popular Posts - All Times