Recovering Through an Added Datafile with a Backup Control File: Scenario

Background:

Restore a production database with 1 week ago tape backup media and recover / roll forward archived log files until up-to-date. However a new datafile just added to a tablespace in yesterday. As a result, media recovery stopped when applying the archive log files which contains add tablespace operation.

Scenario:

1. Restored a database with backup control file from tape.
2. Roll forward recover database with archived log files.
3. Archive log files contain “Add datafile to tablespace information”

The Errors #1
Unnamed datafile added to backup control file during database recovery.

ALTER DATABASE RECOVER  FROM '/oradata2/arch/eservice/prod/'    CONTINUE DEFAULT
Wed Dec 23 12:25:02 2009
Media Recovery Log /oradata2/arch/eservice/prod/1_80668_629050579.dbf
File #10 added to control file as 'UNNAMED00010'. Originally created as:
'/oradata2/eservice/eservice_housekeep3.dbf'
Some recovered datafiles maybe left media fuzzy
Media recovery may continue but open resetlogs may faileservice
Wed Dec 23 12:25:05 2009
Media Recovery failed with error 1244
ORA-283 signalled during: ALTER DATABASE RECOVER  FROM '/oradata2/arch/eservice/prod/'
    CONTINUE DEFAULT  ...

The Error #2
The datafile creation was failed by some reason, maybe insufficient disk space.

ORA-00283: recovery session canceled due to errors
ORA-01111: name for data file 10 is unknown - rename to correct file
ORA-01110: data file 10: '/opt/oracle/product/dbs/UNNAMED00010'
ORA-01157: cannot identify/lock data file 10 - see DBWR trace file
ORA-01111: name for data file 10 is unknown - rename to correct file
ORA-01110: data file 10: '/opt/oracle/product/dbs/UNNAMED00010'

The Solution:

1. If you just got Error #1, you may just rename the datafile to correct location. And then recover the database again. Ensure no data integrity issue persist.

ALTER DATABASE RENAME FILE '/opt/oracle/product/dbs/UNNAMED00010' TO
                           '/oradata2/eservice/eservice_housekeep3.dbf';

2. If you got both, you have to recreate the datafile before you resume the recovery.

alter database create datafile '/opt/oracle/product/dbs/UNNAMED00010' as '/oradata2/eservice/eservice_housekeep3.dbf'

3. Recover again

SET AUTOrecovery on;
set logsource /oradata2/arch/eservice/prod/;
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;

Recovery performed successfully

ORA-00279: change 606139213 generated at 12/24/2009 02:15:30 needed for thread
1
ORA-00289: suggestion : /oradata2/arch/eservice/prod/1_80741_629050579.dbf
ORA-00280: change 606139213 for thread 1 is in sequence #80741
ORA-00278: log file '/oradata2/arch/eservice/prod/1_80740_629050579.dbf' no longer
needed for this recovery

ORA-00308: cannot open archived log
'/oradata2/arch/eservice/prod/1_80741_629050579.dbf'
ORA-27037: unable to obtain file status
HPUX-ia64 Error: 2: No such file or directory
Additional information: 3

In case your recovery was failed and tablespace is inconsistent, you will get this error.

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01245: offline file 10 will be lost if RESETLOGS is done
ORA-01110: data file 10: '/oradata2/eservice/eservice_housekeep3.dbf'

Reference:
http://www.filibeto.org/sun/lib/nonsun/oracle/10.2.0.1.0/B19306_01/backup.102/b14191/recoscen002.htm