Getting Started Database Backup and Recovery with RMAN

Getting Started Database Backup and Recovery with RMAN






RMAN (Recovery Manager) is a backup and recovery manager supplied for Oracle created by the Oracle Corporation. it includes features not available in third-party backup tools. RMAN was introduced in Oracle release 8.0.

Oracle Recovery Manager satisfies the most pressing demands of performant, manageable backup and recovery, for all Oracle data formats. RMAN takes care of all underlying database procedures before and after backup or restore, freeing dependency on OS and SQL*Plus scripts. It provides a common interface, via command line and Enterprise Manager, for backup tasks across different host operating systems and offers features not available through user-managed methods, such as parallelization of backup/restore data streams, backup files retention policy, and detailed history of all backups.

Overview of the RMAN Environment

Recovery Manager (RMAN) is an Oracle Database client that performs backup and recovery tasks on your databases and automates administration of your backup strategies. It greatly simplifies backing up, restoring, and recovering database files.

The RMAN environment consists of the utilities and databases that play a role in backing up your data. At a minimum, the environment for RMAN must include the following components:

A Target database

An Oracle database to which RMAN is connected with the TARGET keyword. A target database is a database on which RMAN is performing backup and recovery operations. RMAN always maintains metadata about its operations on a database in the control file of the database. The RMAN metadata is known as the RMAN repository.

The RMAN client

An Oracle Database executable that interprets commands, directs server sessions to execute those commands, and records its activity in the target database control file. The RMAN executable is automatically installed with the database and is typically located in the same directory as the other database executables. For example, the RMAN client on Linux is located in $ORACLE_HOME/bin.

RMAN is very flexible and it offers many different types of backups.  We need to start with a list of backup types:

Full backup: A full backup backs up all data files in the database, block-by-block, a standalone backup with everything you need to recover to the point in time when the full backup was collected.

Incremental backup:  An incremental backup can be either level 0 or level 1. There are two types of incremental backups, “differential” and “cumulative”.

Differential Incremental Backup:  When using differential incremental backup (the default type of incremental backup), RMAN looks for changed data blocks which were changed after last level 1 incremental backup. It there’s no level 1 backup made before it, it takes a backup of the changed data blocks which were made after level 0 incremental backup.

Cumulative Incremental Backup:  In a cumulative incremental backup RMAN takes backup of all changed data blocks after level 0 or level 1 incremental backup.  Like a differential backup, incremental backups also back up only the changed data blocks, but an incremental backup only backs up the data that has changed since the last backup.  If the last backup was also an incremental backup, the current incremental backups only records “changes to the changes”, a much smaller set of block changes, and hence, a much smaller recovery time than a differential backup.

With Oracle Database 12c Release 2, RMAN further expands the level of granularity, flexibility, and performance of database backup and recovery operations:

Pluggable Database (PDB) Point-in-Time Flashback Recovery – Reverse unwanted changes made to a single PDB without impacting the operation of the remaining PDBs.

  • Nonlogged Data Block Recovery in Data Guard – Perform recovery of nonlogged data blocks by fetching data blocks from the primary or physical standby database.
  • Nonlogged Data Block Validation in Data Guard – Perform validation to determine if the data blocks in the nonlogged block ranges are still valid.
  • Enhancement for Recovery of Tables – Recover tables or table partitions into a schema that differs from the schema in which these objects originally existed.
  • Enhancement for Duplicate Command – DUPLICATE can now be used to create an Oracle Data Guard far sync instance by duplicating a target database.
  • Enhancement for Cross-Platform Transport – Transport a PDB into a cross-platform target CDB as well as transport of tablespaces over the network to a cross-platform target.
  • Backup and Recovery of Sparse Databases – Back up, restore, recover, and duplicate sparse data files, tablespaces, CDBs, PDBs, and whole databases.