Search This Blog

Wednesday, January 17, 2007

About RMAN Backups

About RMAN Backups
An image copy is an exact copy of a single datafile, archived redo log file, or control file

Backups of Archived Logs
Deletion of Archived Logs After Backups

RMAN backs up exactly one copy of each specified log sequence number and thread from an archive destination to tape, and then deletes the specific file.
it backed up while leaving the other copies on disk
RMAN backs up exactly one copy of each specified log sequence number and thread, and then deletes that log from all archive destinations

Filenames for Image Copies
FORMAT variables are also used to specify the names of image copies. The default format %U.

Tags for RMAN Backups
The maximum length of a tag is 30 bytes.
Tag Weekly_Hot_db02_bkp

Size of Backup Pieces
RMAN will, by default, put the entire contents of a backup set into one backup piece

I/O Read Rate of Backups
By default, RMAN uses all available I/O bandwidth to read/write to disk. You can limit the I/O resources consumed by a backup job with the RATE option of the ALLOCATE CHANNEL or CONFIGURE CHANNEL commands. The RATE option specifies the maximum number of bytes for each second that RMAN reads on the channel.


RMAN Backup Types

Full or incremental
Open or closed
Consistent or inconsistent

Note: A full backup is different from a whole database backup, which is a backup of all datafiles and the current control file.

Closed Backup
A backup of any part of the target database when it is mounted but not open. Closed backups can be consistent or inconsistent
The only difference between a level 0 incremental backup and a full backup is that a full backup is never included in an incremental strategy.

A level 1 incremental backup can be either of the following types:

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
Incremental backups are differential by default.

Control File and Server Parameter File Autobackups

RMAN can automatically back up the control file and server parameter file (SPFILE) in situations in which the RMAN repository data for your database has been updated in a way that affects RMAN's ability to restore your database.
with a control file autobackup, RMAN can recover the database even if the current control file, recovery catalog, and server parameter file are inaccessible.

If control file autobackups are OFF and the backup includes datafile 1, then RMAN includes the current control file and SPFILE in the same backup set as the datafiles.
The control file autobackup filename has a default format of %F for all device types.

Backup Retention Policies
RMAN considers backups of datafiles and control files as obsolete, that is, no longer needed for recovery, according to criteria that you specify in the CONFIGURE command. You can then use the REPORT OBSOLETE command to view obsolete files and DELETE OBSOLETE to delete them.

RMAN>report obsolete;
RMAN>delete obsolete;

If you have a flash recovery area configured, however, then the database automatically deletes unnecessary files from the flash recovery area based on its internal disk quota rules. The disk quota rules are distinct from the backup retention policy rules, but the database will never delete files in violation of the retention policy to satisfy the disk quota.

The term obsolete does not mean the same as expired.
RMAN>crosscheck backup;
RMAN> crosscheck archivelog all;
In short, obsolete means "not needed," whereas expired means "not found."
RMAN> delete expired backup;
RMAN> delete expired archivelog all;
The CROSSCHECK command does not delete operating system files or remove repository records. You must use the DELETE command for these operations

You can also disable the retention policy completely.

Recovery Window
Backup Redundancy
A redundancy-based retention policy specifies how many backups of each datafile must be retained
The default retention policy is REDUNDANCY = 1

Batch Deletes of Obsolete Backups
Run the REPORT OBSOLETE command to determine which backups are currently obsolete according to the retention policy.

Backup Optimization
Backup optimization is a feature that avoids creating identical backup copies of files that have not changed since the last time they were backed up. If you enable backup optimization, then the BACKUP command skips the backup of a file when the identical file has already been backed up to the allocated device type.

Type of File Criteria to Determine an Identical File
Datafile Same DBID, checkpoint SCN, creation SCN, and RESETLOGS SCN and time. The datafile must be offline-normal, read-only, or closed normally.

Archived redo log Same thread, sequence number, and RESETLOGS SCN and time.

Backup set Same backup set recid and stamp.

RMAN Backup Errors
RMAN detects and responds to two primary types of backup errors: I/O errors and corrupt blocks
If RMAN encounters datafile blocks that have not already been identified as corrupt, then RMAN stops the backup
Check about corruption block on V$DATABASE_BLOCK_CORRUPTION view

Tests and Integrity Checks for Backups
You can use the BACKUP VALIDATE and RESTORE VALIDATE commands to test backup and restore operations
RMAN> backup validate database;
RMAN> backup validate database archivelog all;

RMAN> restore validate database;
RMAN> restore validate database archivelog all;

Detecting Physical and Logical Block Corruption
At the end of a backup, RMAN stores the corruption information in the recovery catalog and control file. Access this data using the V$DATABASE_BLOCK_CORRUPTION view.

Detection of Logical Block Corruption
the database can also test data and index blocks for logical corruption, such as corruption of a row piece or index entry.
If RMAN finds logical corruption, then it logs the block in the alert.log. If CHECK LOGICAL was used,
By default, error checking for logical corruption is disabled.


Anonymous said...


Im currently studying how to use RMAN backup. Are the commands here in your post also work in 10gR2 ( ?

Keep up the good work.


stupid said...

Really Good info for a new DBA! Thanks!