Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2013
    Posts
    2

    Unanswered: RMAN-06023 when restoring full database (due to new datafiles)

    Hi all,

    Got a quick RMAN restore question which seems like it should be a common situation .. but I'm not having much luck finding the answer and the things I've tried seem contradictory...

    I'm testing out various RMAN restore/recovery scenarios for 10g R1. Took a full level-0 backup of one of our larger databases (16 tb) and I'm trying to restore the whole thing on another server. While the backup was running (for about a day & a half), a few datafiles were added. The backup completed fine, including "backup current controlfile;". Now my restore is failing with "RMAN-06023: no backup or copy of datafile xxxx found to restore", with reference to the 4 files that were added while the backup was in progress.

    So RMAN won't restore the db because it didn't take a backup of these 4 files which were added during the backup. I guess if the datafiles were added after the backup had finished, we'd be fine because they'd be created during recovery with our archive logs (we have all of those).

    I found some suggestions for first doing a "restore controlfile;" -- did that and it worked fine -- then mounting the database and creating the datafiles manually. I added that to my RMAN restore script and tried it, like so:

    run {
    allocate channel d4 type disk format '/BK01/dbX/stream1/df_%t_s%s_s%p' ;
    sql "alter database create datafile ''/uXX/oradata/dbX/datafile_58.dbf''";
    restore database ;
    }

    The datafiles were created successfully, and the restore began .. but then it failed with this:

    creating datafile fno=4216 name=/uXX/oradata/dbX/datafile_58.dbf
    ...
    RMAN-03002: failure of restore command at 06/20/2013 17:27:28
    ORA-01119: error in creating database file '/uXX/oradata/dbX/datafile_58.dbf
    ORA-27038: created file already exists


    ... So RMAN seems to be telling me that if these 4 datafiles don't exist in the backupset, then RMAN won't automatically create them as part of the restore. But if I manually create them first, then RMAN will try to restore them and complain that they already exist. That doesn't make sense to me. And for that matter, I would have expected that RMAN would be smart enough to detect that those 4 files were added while the backup was active, and just include them in the backup. Maybe there's something I needed to do to tell RMAN to do that when I originally ran the backup?

    This is just a test, so of course I can redo the backup from scratch and try again, but we have some pretty large databases which cannot be shut down for cold backups, so it's entirely possible this scenario could show up in a real disaster recovery. RMAN does such a good job of managing things that I feel there must be a simple answer, but for whatever reason, I cannot find it. If anyone has any suggestions I'd be very appreciative! Thanks. Please excuse if I'm not explaining some part of that clearly.

  2. #2
    Join Date
    Jun 2013
    Posts
    2
    Ha ha! I found the solution. Posting details here in case it may be of use to anyone else who encounters the same issue.

    Briefly: if I tried to restore the database with this method:
    sql> startup nomount;
    rman> restore database;

    ... the restore would fail with "RMAN-06023: no backup or copy of datafile xxxx found to restore".

    But when I tried it with this sequence:
    sql> startup nomount;
    rman> restore controlfile;
    sql> alter database mount;
    rman> restore database;

    ... it worked! RMAN created the datafiles I needed and proceeded on with the restore.

    From the log:
    Starting restore at 20-JUN-13
    creating datafile fno=4216 name=/uXX/oradata/dbX/datafile_58.dbf
    ...
    channel d1: starting datafile backupset restore
    channel d1: specifying datafile(s) to restore from backup set
    ...
    and so on. I presume the restore will complete successfully now that we are past this one problem. I will update with more detail if there are any more issues related to the original topic. Thanks all!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •