Databases Reference
In-Depth Information
Backing Up Archived Redo Logs
Problem
You want to back up the archived redo logs by themselves.
Solution
Use the
backup archivelog
command to back up archived redo logs. To back up one copy of each log sequence number
for all the archived redo logs, for example, you can issue the following command:
RMAN> backup archivelog all;
The
backup archivelog
command shown in this example will back up only a single copy of each of the archived
redo logs, even if there are multiple copies of those logs. That is, the command will back up a single copy of each
distinct log sequence number per thread.
The following example shows how to use the
archivelog like
clause with the
backup
command to back up one
archived redo log for each unique log sequence number:
RMAN> backup device type sbt
archivelog like '/disk%arc%'
delete all input;
Let's say you have two archiving destinations, one called /disk1/arch/ and the other called /disk2/arch/.
If a certain archived redo log, say, log 9999, is in both directories, RMAN will back up only one of the copies, not both.
The
delete all input
clause deletes all archived redo logs from all (in this case, two) destinations after the backup.
You can limit the backup of the archived redo logs based on a specific time, SCN, or log sequence number. In the
following example, the clauses
from time
and
until time
limit the range of the archived redo log backups:
RMAN> backup archivelog
from time "sysdate-15" until time "sysdate-7";
The previous command uses a specified time period to direct the backing up of all archive logs generated
between two weeks ago and last week. To back up archived redo logs based on specific log sequence numbers, use the
keyword
sequence
and provide either a specific log sequence number or a range for the sequence numbers. Here are
some examples:
RMAN> backup archivelog sequence 99
delete input; # specifies a particular log sequence number
RMAN> backup archivelog sequence between 99 and 199 thread 1
delete input; # specifies range of records by log sequence numbers
In both examples, the
delete input
clause directs RMAN to delete the backed-up archived redo log files after
they're successfully backed up.