As with full backups, if you are in ARCHIVELOG mode, you can make
incremental backups if the database is open; if the database is in
NOARCHIVELOG mode, then you can only make incremental backups after
a consistent shutdown.
See Also:
Oracle Database Concepts for more information about NOLOGGING mode
One effective strategy is to make incremental backups to disk, and then back up
the resulting backup sets to a media manager with BACKUP AS BACKUPSET. The
incremental backups are generally smaller than full backups, which limits the
space required to store them until they are moved to tape. Then, when the
incremental backups on disk are backed up to tape, it is more likely that tape
streaming can be sustained because all blocks of the incremental backup are
copied to tape. There is no possibility of delay due to time required for RMAN to
locate changed blocks in the datafiles.
A differential backup, which backs up all blocks changed after the most
recent incremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most
recent incremental backup at level 0
Sunday
An incremental level 0 backup backs up all blocks that have ever been in
use in this database.
Monday - Saturday
On each day from Monday through Saturday, a differential incremental
level 1 backup backs up all blocks that have changed since the most
recent incremental backup at level 1 or 0. So, the Monday backup copies
blocks changed since Sunday level 0 backup, the Tuesday backup copies
blocks changed since the Monday level 1 backup, and so forth.
time than differential backups, however, because they duplicate the work done
by previous backups at the same level.
The following command performs a cumulative level 1 incremental backup of the
database:
Sunday
An incremental level 0 backup backs up all blocks that have ever been in
use in this database.
Monday - Saturday
A cumulative incremental level 1 backup copy all blocks changed since the
most recent level 0 backup. Because the most recent level 0 backup was
This example makes a differential level 1 backup of the SYSTEM tablespace and
datafile tools01.dbf. It will only back up those data blocks changed since the
most recent level 1 or level 0 backup:
RUN {
RECOVER COPY OF DATABASE WITH TAG 'incr_update';
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG
'incr_update'
DATABASE;
}
The syntax used in the script does not however, make it clear how the strategy
works. To understand the script and the strategy, it is necessary to understand
the effects of these two commands when no datafile copies or incremental
backups exist.
Note also the following details about how this example works:
Each time a datafile is added to the database, an image copy of the new
datafile is created the next time the script runs. The time after that, the
first level 1 incremental for that datafile is created, and on all subsequent
runs the new datafile is processed like any other datafile.
Tags must be used to identify the incremental level 0 datafile 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.
Hence Tag is used to specify level 0 backup copy incase if we dont have it by the
time we are trying to have level 1 backup.
The incremental level 1 backups to apply to those image copies are
selected based upon the checkpoint SCNs of the image copy datafiles and
the available incremental level 1 backups. (The tag used on the image
copy being recovered is not a factor in the selection of the incremental
level backups.)
In practice, you would schedule the example script to run once each day,
possibly at midnight. On a typical night (that is, after the first two nights), when
the script completed the following files would be available for a point-in-time
recovery:
If, at some point during the following 24 hours, you need to restore and recover
your database from this backup, for either complete or point-in-time recovery,
you can restore the datafiles from the incrementally updated datafile copies, and
apply changes from the most recent incremental level 1 and the redo logs to
reach the desired SCN. At most, you will have 24 hours of redo to apply, which
limits how long point-in-time recovery will take.
See Also:
Oracle Database 2 Day DBA to see how this technique is used in the Oraclesuggested backup strategy in Enterprise Manager.
RUN {
RECOVER COPY OF DATABASE WITH TAG 'incr_update'
UNTIL TIME 'SYSDATE - 7';
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG
'incr_update'
DATABASE;
}
The effect of the script is as follows:
On the first night the RECOVER COPY... UNTIL TIME statement has no
effect, and the BACKUP INCREMENTAL... FOR RECOVER OF COPY
statement creates the incremental level 0 copies.
On the second through seventh nights, the RECOVER COPY... UNTIL
TIME statement has no effect because TIME 'SYSDATE - 7' is still a
time in the future. The BACKUP INCREMENTAL... FOR RECOVER OF
COPY statement creates differential incremental level 1 backups containing
the block changes for the previous day.
On the eighth and all subsequent nights night, the RECOVER COPY...
UNTIL TIME statement applies the level 1 incremental from seven days
ago to the copy of the database. The BACKUP INCREMENTAL... FOR
RECOVER OF COPY statement creates an incremental backup containing
the changes for the previous day.
As with the basic example, you have fast recoverability to any point in time
between the SCN of the datafile copies and the present, using block changes
from the incremental backups and individual changes from the redo logs.
Because you have the daily level 1 incremental, you still never need to apply
more than one day of redo.
if only a small percentage of data blocks are changed between backups. If your
backup strategy involves incremental backups, then you should enable change
tracking.
One change tracking file is created for the whole database. By default, the
change tracking file is created as an Oracle managed file in
DB_CREATE_FILE_DEST. You can also specify the name of the block change
tracking file, placing it in any location you choose.
Note:
In a Real Applications Clusters (RAC) environment, the change tracking file must
be located on shared storage accessible from all nodes in the cluster.
Oracle saves enough change-tracking information to enable incremental backups
to be taken using any of the 8 most recent incremental backups as its parent.
Although RMAN does not support backup and recovery of the change-tracking
file itself, if the whole database or a subset needs to be restored and recovered,
then recovery has no user-visible effect on change tracking. After the restore and
recovery, the change tracking file is cleared, and starts recording block changes
again. The next incremental backup after any recovery is able to use changetracking data.
The REUSE option tells Oracle to overwrite any existing file with the specified
name.
To disable change tracking, use this SQL statement:
2. SELECT filename
3. FROM V$BLOCK_CHANGE_TRACKING;
4.
5. Shut down the database. For example:
6. SHUTDOWN IMMEDIATE
7.
8. Using host operating system commands, move the change tracking file to
its new location.
9. Mount the database and move the change tracking file to a location that
has more space. For example:
11.
12.