1.5 Backup and Recovery with RMAN

As noted earlier, using RMAN gives you access to several data backup and recovery techniques and features not available at all with user-managed backup and recovery. The most noteworthy are:

  • Incremental backups, which provide more compact backups (storing only changed blocks) and faster datafile media recovery (reducing the need to apply redo during datafile media recovery)

  • Block media recovery, in which a datafile with only a small number of corrupt data blocks can be repaired without being taken offline or restored from backup

  • Unused block compression, where RMAN can in some cases skip unused datafile blocks during backups

  • Binary compression, which uses a compression mechanism integrated into the Oracle database server to reduce the size of backups

  • Encrypted backups, which uses encryption capabilities integrated into the Oracle database to store backups in an encrypted format

A complete list of feature differences between RMAN and user-managed backup and recovery can be found in "Feature Comparison of Backup Methods".

RMAN also reduces the administration work associated with your backup strategy. RMAN keeps an extensive record of metadata about backups, archived logs, and its own activities, known as the RMAN repository. In restore operations, RMAN can use this information to eliminate the need for you to identify backup files for use in restores in most situations. You can also generate reports of backup activity using the information in the repository.

Primary storage for RMAN repository information is in the control file of the production database. You can also set up an independent recovery catalog, a schema that stores RMAN repository information for one or many databases in a separate recovery catalog database.

The remainder of this book, Oracle Database Backup and Recovery Basics, focuses on using RMAN to implement your backup and recovery strategy.

1.5.1 Files That RMAN Can Back Up

RMAN can back up all database files needed for efficient recovery in the event of a failure. RMAN supports backing up the following types of files:

  • Datafiles, and image copies of datafiles

  • Control files, and image copies of control files

  • Archived redo logs

  • The current server parameter file

  • Backup pieces, containing other backups created by RMAN

Note:

Although the database depends on other types of files for operation, such as network configuration files, password files, and the contents of the Oracle home, these files cannot be backed up with RMAN. Likewise, some features of Oracle, such as external tables or the BFILE datatype, store data in files other than those listed here. RMAN cannot back up those files. You must use some non-RMAN backup solution for any files not in the preceding list.

1.5.2 RMAN Backup Destinations: Disk and Media Managers

RMAN can create and manage backups on disk and on tape, back up backups originally created on disk to tape, and restore database files from backups on disk or tape.

Devices used for tape backup are often referred to as SBT (System Backup to Tape) devices. RMAN interacts with SBT devices through software known as a media management layer, or media manager.

1.5.3 Types of Oracle Database Backup under RMAN

There are several ways of distinguishing among physical backups, according to the state the database was in when the backup was created, what parts of the database were actually backed up, and how the resulting backup was stored.

1.5.3.1 About Consistent and Inconsistent Backups

Physical backups can also be divided into consistent and inconsistent backups. Consistent backups are those created when the database is in a consistent state, that is, when all changes in the redo log have been applied to the datafiles. A database restored from a consistent backup can be opened immediately, without undergoing media recovery. However, a consistent backup can only be created after a consistent shutdown, that is, not after a crash or a SHUTDOWN ABORT.

For reasons of availability, the Oracle database is designed to work equally well with an inconsistent backup, a backup taken while the database is open. However, when a database is restored from an inconsistent backup, it must undergo media recovery, so that the database can apply any pending changes from the online and archived redo log before the database is opened again. Because archived logs are required for media recovery, using inconsistent backups requires that your database be run in ARCHIVELOG mode.

1.5.3.2 About Full and Incremental Backups

Full backups are backups which include datafiles in their entirety. Full backups can be created with Recovery Manager or with operating system-level file copy commands. Incremental backups are based on the idea of making copies only of changed data blocks in a data file. In recovery, extracting entire changed blocks from an incremental backup can substitute for applicationof redo for individual datafile updates during the time covered by the backup, shortening recovery times considerably. Incremental backups can only be created with RMAN.

See Also:

"About RMAN Full and Incremental Datafile Backups" for more details about the different ways to back up datafiles.

1.5.3.3 About Image Copies, Backup Sets and Backup Pieces

The results of an Oracle database backup created through RMAN can be either image copies or backup sets. An image copy is a bit-for-bit identical copy of a database file. RMAN can create image copy backups, although in the process, RMAN will check the contents for corruption, something that native operating-system file copy utilities cannot do. RMAN records image copies it creates in the RMAN repository, so that it can use them when restoring your database. Image copies can also be created using operating system commands such as cp in Unix or COPY in Windows.

Note:

If you create image copies outside of RMAN, you must use the CATALOG command to record them in the RMAN repository before RMAN can make use of them.

RMAN can also store its backups in an RMAN-specific format called a backup set. A backup set is a collection of files called backup pieces, each of which may contain the backup of one or several database files. A backup task performed in RMAN can create one or more backup sets, which are recorded in the RMAN repository. Backup sets are also the only form in which RMAN can write backups to media manager devices like tape libraries. Backup sets are only created and accessed through Recovery Manager.

See Also:

"About RMAN Backup Formats: Image Copies and Backup Sets" for more details about image copies and backup sets.