2 Replies Latest reply: Jan 3, 2013 6:28 AM by user522620 RSS

    Moving RMAN backups

    user522620
      Hi
      I am currently backing up an 11G database using the following RAMN script:

      *RUN {*
      RECOVER COPY OF DATABASE WITH TAG 'Incr_Update';
      BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'Incr_Update'
      DATABASE;
      *}*

      Up to this point, all backups (autobackup, backupsets, datafiles) have been writing to the Flash_recovery_area on a disk local to the database.

      I am now attempting to write the backups to a SIF share on a DataDomain server. In doing so, I ran the following rman script:

      *RUN {*
      allocate channel bkp_disk1 type disk format "\\ddnode1\acp95emrdb\ACPbackups\%U";
      RECOVER COPY OF DATABASE WITH TAG 'Incr_Update';
      BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'Incr_Update'
      DATABASE;
      release channel bkp_disk1;
      *}*

      However, the only part of the database being written to the new location is the new Backup Pieces. The Autobackups are still being written to the Flash_recovery_area and the copies of the datafiles remain in the Flash_recovery_area as well.

      So I then changed the DB parameter Flash_recovery_area to point to the SIF share. I ran another backup with the new script and now the Backup Sets and the Auto backups are writing to the new SIF share. However, RMAN continues to see the copies of the datafiles in the old Flash_recovery_area and continues to merge the incremental to the datafiles in the original location.

      I would like to move the entire backup, including the datafiles, autobackup and backupsets to the new location. How do I do this without RMAN "remembering" the datafile copies in the old Flash_recovery_area location?

      Thanks in advance
        • 1. Re: Moving RMAN backups
          P.Forstmann
          You could try to:
          1. physically move the backups sets to new location with Windows
          2. flag as expired all backup sets that RMAN cannot find:
          CROSSCHECK BACKUP;
          3. uncatalog backup sets from step 2 with:
           DELETE EXPIRED BACKUP;
          4. catalog backup sets new location:
          CATALOG START WITH <new location>;
          Note that there is always some risk with DELETE EXPIRED to delete backups that are only temporarily unavailable: you must double check backup sets that are flagged as expired.
          • 2. Re: Moving RMAN backups
            user522620
            Hi
            Thanks for the reply. Yes, that is pretty much what I did. I first backed up my backups so I would have them just in case. Then ran the following:

            crosscheck
            delete backup
            delete copy

            I then ran maintenance against the rman catalog by issuing the following. (not completely necessary, but a little overkill here was not going to hurt anything)

            *RUN {*
            Report Obsolete;
            Crosscheck Backup;
            Crosscheck copy;
            Delete Obsolete;
            Delete Expired Copy;
            Delete Expired Backup;
            *}*

            These two steps deleted all the backups I had at the time and any reference to them in the catalog. Then I ran the backup again, and all files were written to the new SIF share. There are some curious differences, however. First, the datafile copies were placed in the root of the SIF share rather than root/dbname/datafiles as previously had occurred. The autobackups and backupsets are still maintaining the same directory structure, i.e., root/dbname/autoback and root/dbname/backupset.

            Second, on my separate backup job that I run to capture archivelogs, each time that job runs it is creating another autobackup. Not that this is a bad thing, just different than RMAN used to behave, and I am just not sure why it is behaving differently.

            kd