Search This Blog

Tuesday, August 31, 2010

Oracle 10g Rman Configuration & Backup.

In Oracle database we can do two types of backup’s manual or through
Rman(Recovery Manager).

Then there are two backup modes hot and cold.
Hot backup means, that the backup operations are done when the database
is running.Cold backup is done when the database is shut down or
is in mount stage.

This article focuses on the configuration of Rman tool which is
provided by oracle.

su – oracle   # Switch to oracle user.

export ORACLE_SID=orcl   # Set the oracle database sid.

rman target=/   # Enter into RMAN command prompt.

RMAN> show all;

# To check all the parameters which have been configured for Rman.
# All the parameters have default values which have # default
# written at the end.
RMAN> configure retention policy to recovery window of 7 days;

# If the above parameter is set we can ensure that the
# database can be restored and recovered to any point
# in time within the last 7 days.

or
RMAN> configure retention policy to redundancy 3;

# The above mentioned parameter means that minimum
# of 3 recent backups of the database will be kept
# an older backups will be marked obsolete, which
# Rman will later drop in order to free up
# space for latest backups.
# The default value for redundancy is 1.
RMAN> configure controlfile autobackup on;

# This parameter instructs Rman to automatically
# backup the controlfile and spfile when a normal
# backup command is used.


In order to do hot backup the database should be in
archivelog mode and flash recovery area should be configured.


Using RMAN to Perform a Hot Backup

su – oracle
export ORACLE_SID=orcl

rman target=/
# Connect to Rman with the above command.

RMAN>backup database plus archivelog;
# Backup the database along with all the archived log files.

RMAN>backup current controlfile;
# This command is optional if controlfile autobackup parameter is on.

Exit rman;
# exit from rman prompt.


Manual Cold Backups with RMAN

rman target=/

RMAN> sql ‘alter system checkpoint’;
# Force a Checkpoint.

RMAN>shutdown immediate 
RMAN>startup mount

# shutdown the database and start it in mount stage.

RMAN>backup database plus archivelog;
Or
RMAN>backup database;
# use the backup database command only if your database
# is in not in archivelog mode.

RMAN>backup current controlfile;
# backup the control file if autobackup is not set to on.

RMAN>sql 'alter database open';
exit rman;

# Open the database and exit rman prompt.

1 comment:

  1. it is very well crafted with all type of details specified clearly.

    ReplyDelete