Recovering cloned database while datafile was added

We are cloning our primary production database to a test system periodically. Sometimes it happens that we are adding a datafile to the primary database while the copy is in progress. After the copy we are creating a new control file based on the production ( with the new datafile ), trying to recover the cloned database we are getting the following error (from the alert.log):
SQL> alter database recover automatic until time '2009-03-15 16:00:00' using backup controlfile;
File #114 added to control file as 'UNNAMED00114'. Originally created as:
'/bzq1/oracalls_2009_indx1/q109_icalls_ts_05.dbf'
Errors with log /bilpre/oraarch/bzq1_1_0000048990_561428818.arc
Some recovered datafiles maybe left media fuzzy
Media recovery may continue but open resetlogs may fail
Media Recovery failed with error 1244
ORA-283 signalled during: alter database recover automatic until time '2009-03-15 16:00:00' using backup controlfile...

It seems that in the archive log there is data regarding to the new datafile, so we need to create it also in the cloned database. To find out what is the current full location that is written in the cloned database:
SQL> select name from v$datafile where name like '%UNNAMED00114%';
NAME
-------------------------------
/software/oracle/BILPRE10gR2/dbs/UNNAMED00114

Now we have the information for the following command :
SQL> alter database create datafile '/software/oracle/BILPRE10gR2/dbs/UNNAMED00114' as '/bilpre/oracalls_2009_indx1/q109_icalls_ts_05.dbf'
Database altered.
SQL> alter database recover automatic until time '2009-03-15 16:00:00' using backup controlfile;
Media Recovery Complete (bilpre)
SQL> alter database open resetlogs;

The Database is working, and there is no need to copy it again

Comments

Popular posts from this blog

Silent Installation

Data Guard - Changing IP Addresses

Fixing & Registering ORACLE_HOMES in Central Inventory