How to make a backup of an Oracle database that does not mess up the regular backup cycle

migrationoracleoracle-11grman

Goal

I want to move a database from server A to server B. Both server have the same technology so one way is to shutdown the source database, copy data files,control file, redo logs, parameter file to from A to B and start the database on B. But this will take to long so I will use a method that involves the archive logs. For example I can use dataguard an build a standby on SERVER B and switch to this standby during migration. But for some reasons I don't want to use a standby nor can I access the backup of the A database to restore it on B.

Method

Before RMAN I did this the following way:

  1. Set the database of A in backup mode and copy all data files to a disk attached to the server and unset the backup mode.
  2. Move this disk to B and attache it to it.
  3. Now from time to time archives are transported to B and applied
  4. During the migration the last archives are brought to B and applied and the database is copied.

Of course I can try this with RMAN, too. And instead copying all the archives I can use incremental backups too.

So I do the following:

  1. Make a level 0 backup to a disk attached to server A.
  2. Move the disk to B and restore the database on Server B.
  3. Now from time to time archives are transported to B and applied
  4. During the migration the last archives are brought to B and applied and the database is copied.

I even could apply incremental backup instead of archives except for the last phase but here I am not interested in that.

Problem

My problem is now that the database on A is backed up using incremental backups:
1. On Sunday a level 0 backup is taken
2. on the remaining 6 days a level 1 backup is taken

I want to to copy my level 0 backup for migration on Wednesday. But this messes up the regular backup. Assume I do this level 0 backup on Wednesday morning then the nightly level 1 backup on Wednesday
refers to the level 0 backup on this morning and not to the level 1 backup of the previous day as usual. But in case of a restore/recovery Thursday we have a problem, because the disk
of the Wednesday level 0 backup is not available anymore. I think the database can be still recovered because the missing time interval can be recovered with archive logs.
But I want a solution that does not mess up the regular backup. So the level 1 backup On Wednesday should refer to the level 1 backup on Tuesday.

Solutions

How can I achieve this?

At the moment I see the following way:

I use duplicate from active database to make a copy of the database on A to the disk attached to A. This database must not be opened so that I can recover it with archive logs later. This disk is detached from A and moved to B. Here the datafiles are registered as datafile copies and restored to th server B.

But this needs an additional instance on A so that I can duplicate to this instance.

Another way may be

 BACKUP INCREMENTAL LEVEL 1... FOR RECOVER OF COPY WITH TAG... 

as described here

The manual says:

The BACKUP INCREMENTAL LEVEL 1... FOR RECOVER OF COPY WITH TAG... command does not actually always create a level 1 incremental backup.
If there is no level 0 image copy backup of an particular data file, then executing this command creates an
image copy backup of the data file on disk with the specified tag instead of creating the level 1 backup.

Each time a data file is added to the database, an image copy of the new data file is created the next time the script runs.
The time after that, the first level 1 incremental for that data file is created, and on all subsequent runs the new data file
is processed like any other data file.

Tags must be used to identify the incremental level 0 data file copies created for use in this strategy,
so that they do not interfere with other backup strategies you implement. If you have multiple incremental
backup strategies in effect, RMAN cannot unambiguously create incremental level 1 backups unless you tag level 0 backups.

This sounds good but I actually have to test this.

My question

What method do you propose to get a level 0 online backup that is ignored by the following level 0 backup of the regular backup cycle?

Best Answer

I'd use RMAN to DUPLICATE DATABASE TO OTHERDB. Feel free to use one of the related methods that fits your environment/requirements.

References: