Вы находитесь на странице: 1из 43


by Karan Kukreja

What is RMAN and why RMAN ?

A General Comparison
RMAN Basics and Configuration Backup options with RMAN

Hot and Cold Backup

Incremental and Full Backup Demo Slides for understanding


by Karan Kukreja

What is RMAN and why choose RMAN ?

by Karan Kukreja

Recovery MANager is a utility provided by Oracle (Ver. 8 onwards).

It is used to perform backup and recovery tasks on the databases and automates administration of the backup strategies.
It greatly simplifies backing up, restoring, and recovering database files. Since its a free utility can be easily adopted by DBAs without extra cost. Can be used to backup the entire database. Enables DBA to take complete backup every time or only the modified Data. Allows the users to compress the backup set.

by Karan Kukreja

Enables parallel backups. RMAN generates a log of all the backup it takes. Allows hot and cold backups.

Stores the backup on tape rather than disk.( Requires Media Management Software).
Maintains a separate repository of Backup Metadata.

Knows what backup is redundant/obsolete.

by Karan Kukreja

A general Comparison

by Karan Kukreja

by Karan Kukreja

RMAN Basics and Configuration

by Karan Kukreja

Target database - the Oracle database which the backup or recovery

operations are being performed.

RMAN client executable that interprets commands, directs server

sessions to execute those commands, and records its activity in the target database control file (or catalog).
RMAN Channel Connection to the target database. All tasks done by

RMAN are done through this channel. By default only one channel is allocated. By default , all the backups are stored at the location : $ORACLE_HOME/dbs path.
To change the location we use the following command :

Configure channel device type disk format /u01/app/oracle/RMAN_NEW;

by Karan Kukreja

Media manager - An application required for RMAN to interface with

sequential media devices such as tape libraries. A media manager controls these devices during backup and recovery, managing the loading, labeling, and unloading of media. It is optional to use this.
Recovery catalog All the tracks of activities done by RMAN are

generally stored in the control file of the target database. This is not a good practice and the alternate method is to create another database called the recovery database which has a recovery catalog schema. That schema will hold all the tracks. Once the recovery catalog schema is created , it needs to be registered with the target database for achieving the desired functionality. It is optional.

by Karan Kukreja


RMAN works only when the database is set in the Archive log mode, although

it works in the noarchive log mode also , but for taking the backups , it is required to shutdown the database. dThese backups are just like Cold Backups.

RMAN does not backup the control file until and unless its a full backup , but it

can be changed to always backup the control file with the following command: enable controlfile autobackup on;

RMAN can be used to backup/restore/recover only datafiles, archive files,

control files and spfile. It cannot include the redolog file.

All the backups made by RMAN are stored in the Operating system specific

location but it can be configured to be backed up on devices like tape, after configuring the SBT. (To configure the Tape setup).

Only backup set backups can be written onto the tape , image copies cannot be

written onto the tapes.

by Karan Kukreja


Retention Policy We can configure a backup retention policy in RMAN , which means

we can decide for how long in future do we need to keep the backup. Once the backup gets older than the time specified in the retention policy , it is marked as obsolete. List obsolete command will now show this in the list and delete obsolete will delete this backup from the list.
rman> configure retention policy to recovery window of 28 days; This will keep a backup non-obsolete for 28 days. To remove from the retention policy give the command: rman> Configure retention policy clear;

by Karan Kukreja


Backup Options under RMAN Backup set and image copy

by Karan Kukreja


Logical backup of the database. Creates a backup Piece( Physical) where the backup resides. Takes backup of only used datablocks. One backup set will create only one backup piece. It can be used to backup the datafiles, controlfiles, archived redo logs and current Spfile. Backup can be backed up to tape.
For example:

by Karan Kukreja


Bit by Bit duplication of the data file. Identical copy made of the database. Include the free and corrupted blocks also for copying. Just works like operating system copy command( cp). The Image backup cannot be copied on the tape. Spfile cannot be backed up using image copy. as copy keywords as used to signify image copy.

by Karan Kukreja


Is RMAN hot or cold ?


by Karan Kukreja


Hot Backup

Taking the backup while the database is up and running. This does not involve shutting down the database instance while the database is undergoing backup. Could be Full or incremental. Example : Connect to the rman : $ rman rman>backup database; rman>backup arcvhivelog all; This will backup the database while its still running. What is important here is that we need to backup the archive logs also to ensure that the backup is consistent. A backup without the archivelog backup is inconsistent and cannot be used to restore the database. Rman is mostly used for taking this HOT backup as this gives a backup without taking any downtime. Usefull across all production systems.

by Karan Kukreja


Cold Backup

Follows three simple processes: Shutdown the database Start the database in mount state Start the backup OPEN the database

For Example :

$ rman rman>shutdown immediate; rman>startup mount rman>backup database; rman>sql alter database open;
Here we need not take archive log backup because the database is in mount state and no activity is going on , so the database is already in the consistent state.

by Karan Kukreja


Do I really need to take the Full backup every


by Karan Kukreja


A full backup is the complete backup of the

This is performed using a simple query :

Backup database;
It can be either Hot ( when database is running) or Cold(

when database is in mount state).

A full backup will be either a backup set or Image copy.
by Karan Kukreja


The purpose of the incremental backup is to backup only those

datablocks that have changed since the last backup. In this way backup will be of lesser size and faster( Generally). Algorithm used : Each datablock has a SCN ( System Change Number). During incremental backup it will check if the SCN has been updated post old backup. If yes , it will backup that datablock else ignore it.
Incremental backup is of 2 types : Level 0 Like Full backup, backs up entire data. Level 1
Differential Cumulative
by Karan Kukreja


Differential backup backs up all the blocks that have

changed after level 1 or level 0 backup.

by Karan Kukreja


The Cumulative backup backs up all the blocks that

have got updated after Level 0.

by Karan Kukreja


Recovery Speed : Cumulative backups are faster to restore

from than differential backups because fewer incremental backups need to be applied during recovery.
backups run faster than cumulative backups because to dont duplicate the work done by previous backups. However, differential backups take longer when doing a recovery. space because they duplicate the work done by previous backups.
by Karan Kukreja

Backup speed: For daily backup speed, differential

Disk space usage: Cumulative backups take more disk


Are you all Still with me ? Lets take a tour through


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


by Karan Kukreja


http://download.oracle.com/ http://metalink.oracle.com http://www.dba-oracle.com/t_rman_backup_types.htm http://www.cuddletech.com/articles/oracle/node59.html

by Karan Kukreja


Thank You for watching this slide. For any questions / queries/ comments you can reach

me at : Karankukreja1988@gmail.com https://www.facebook.com/groups/141825412627443/

by Karan Kukreja