Databases Reference
In-Depth Information
Solution
By using the
duration
parameter as part of your
backup
command, you can specify a window for an RMAN backup.
The backup either will complete during the time interval you specify with the
duration
parameter or will stop midway
through the backup if it doesn't finish within the specified time. RMAN may or may not issue an error when an
ongoing backup runs past the backup window, based on your selection of certain options.
Here's an example that shows how to limit an RMAN backup to six hours:
RMAN> backup duration 6:00
database;
You can use the
duration
clause along with other clauses to control what happens when a backup fails to
complete within the specified time interval. By default, RMAN reports an error when the backup is interrupted
because of the end of the backup interval. If your
backup
command is part of a
run
block, that
run
block will also
terminate immediately. By using the optional clause
partial
, you can suppress the RMAN error reports and instead
have RMAN merely report which data files it couldn't back up because of a lack of time. Here's an example:
RMAN> backup duration 6:00 partial
database
filesperset 1 ;
In addition to not issuing any error messages, the
partial
clause also lets the other commands within a
run
block continue to execute after the termination of a backup when the window of time for backups expires. You can
also use the
duration
clause along with one of two other options to control the
speed
of the backup. To perform the
backup in the shortest time possible, specify the
minimize time
option, as shown here:
RMAN> backup
duration 6:00 partial
minimize time
database
filesperset 1;
On the other hand, if you think that the backup may not go over the backup window, you can reduce the overhead
imposed by the backup with the
minimize load
option with the
duration
clause, as shown here:
RMAN> backup
duration 6:00 partial
minimize load
database
filesperset 1;
When you specify the
minimize load
clause, RMAN extends the backup (slows it down) to take advantage of all
the time that's available to it.
How It Works
Each of the
backup
commands shown in the Solution section specifies the
filesperset
parameter. When you specify
filesperset=1
, each file gets its own backup set. Thus, when the backup is terminated when you bump up against
the backup window, only the backup of a particular data file is lost, and all the other backup sets already made will be
good. When you resume the backup afterward, you don't have to back up these data files again (this may not be true if
the SCNS of the data file headers have changed since the most recent backup).