Recovery manager (RMAN) is a command line utility used to perform backup and recovery. The key objective of RMAN is to provide greater ease of management and administration of the backup and recovery operations.

This article for new users who want to start using RMAN right away without first reading more details. This article provides most important RMAN concepts and tasks.

RMAN Components

The RMAN environment consists of the utilities and databases that play a role in backing up your data. RMAN includes following main components.

Target Database

The target database is the database that you are backing up, restoring, or recovering with RMAN Backup.

RMAN Client

The client application that manages backup and recovery operations for a target database can be located on any host.

RMAN Repository

RMAN Backup maintains metadata about its operations; this RMAN metadata is called as RMAN repository and stored in control file of the database.

You may require some optional components in backup and recovery process which includes Flash Recovery Area, Recovery Catalog, Enterprise Manager, Standby database, Duplicate database, Media Manager, Media Manager Catalog.

Read More ...

Starting RMAN and Connecting to Target Database

Connecting to RMAN can be achieved by simply typing RMAN at the operating system prompt. When connection is made with RMAN you can issues RMAN Connect command with target or auxiliary database with or without recovery catalog. RMAN requires SYSDBA privilege to connect.

The following example starts RMAN and connect to target database without catalog.

RMAN> CONNECT TARGET SYS/pass@TEST1;

To quit the RMAN client, enter EXIT at the RMAN prompt:

RMAN> EXIT

Read More ...

Configure RMAN Environment

The RMAN backup and recovery environment is preconfigured for each target database. The RMAN configuration is persistent and applies to all subsequent operations on target database, even if you exit and restart RMAN.

Oracle backup provides following destination for RMAN backup.

Disk (The flash recovery area)

RMAN automatically store disk type recovery related files in a flash recovery area. Flash recovery simplifies managing disk space and files related to backup and recovery. Following parameter need to be set before using flash recovery area

DB_RECOVERY_FILE_DEST //sets Flash recovery area location on disk
DB_RECOVERY_FILE_DEST_SIZE //sets Flash recovery area size

When a flash recovery is set you can also set the retention policy for automatic deletion of obsolete backups.

Tape device or media managers

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. By default RMAN creates disk type backups but can also take external backup on tape device

RMAN Backup Initialization Parameters

A number of initialization parameters are used to control RMAN Backup. Some important parameters are.

CONTROL_FILE_RECORD_KEEP_TIME

A record of all RMAN backups is kept in the target control file. This parameter specifies the number of days that RMAN will attempt to keep a record of backups in the target control file. After this time, RMAN will begin to reuse records older than this retention period.

if the space is not available for the expansion of the control file, RMAN will reuse the oldest record in the control file and write a message to the alert log. you should set CONTROL_FILE_RECORD_KEEP_TIME to several days beyond your actual recovery window to ensure that backup records are retained in the control file. The default is 7 days.

DB_RECOVERY_FILE_DEST

This parameter specifies the location of the flash recovery area. It should be located on a file system different from any database datafiles, control files, or redo log files, online or archived.

DB_RECOVERY_FILE_DEST_SIZE

The parameter specifies an upper limit to the amount of space used for the flash recovery area.

The parameters DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE are both dynamic; they can be changed on the fly while the instance is running.

RMAN Configurations

RMAN configurations control many aspects of RMAN's behavior, such as backup retention policy, default destinations for backups to tape or disk, default backup device type (tape or disk), and so on.

The default configuration is adequate for most purposes. However, you may change or override as needed.

You can use the SHOW and CONFIGURE commands to view and change RMAN configurations.

  1. Show RMAN Backup Configurations
  2. Clear RMAN Backup Configurations
  3. Configure RMAN Backup Device Type: Disk or SBT
  4. Configure RMAN Backup Type: Backup Sets or Copies
  5. Configure RMAN Channel
  6. Configure RMAN Control File Autobackup
  7. Configure RMAN Retention Policy
  8. Configure RMAN Backup Compression
  9. Configure RMAN Tablespace Exclusion

Read More ...

RMAN Backups

The primary purpose of RMAN backups is to protect your data. If a media failure or disaster occurs, then you can restore your backups and recover lost changes. You can back up all or part of your database with the BACKUP command from within the RMAN client. RMAN BACKUP command uses the pre configured settings, the records of previous backups, and the control file record of the database structure to determine an efficient set of steps for the backup.

By default, RMAN creates backups on disk. If a fast recovery area is enabled and automatically gives them unique names.

BackUp a Database in ARCHIVELOG Mode

If a database runs in ARCHIVELOG mode, then you can back up the database while it is open. The backup is called an inconsistent backup because redo is required during recovery to bring the database to a consistent state.

  1. Start RMAN and connect to a target database.
  2. Run the BACKUP DATABASE command.
RMAN> BACKUP DATABASE;

Back Up a Database in NOARCHIVELOG Mode

If a database runs in NOARCHIVELOG mode, the only valid database backup is a consistent backup. For the backup to be consistent, the database must be mounted after a consistent shutdown. No recovery is required after restoring the backup.

  • Start RMAN and connect to a target database.
  • Shut down the database consistently and then mount it. For example, enter the following commands to guarantee that the database is in a consistent state for a backup:
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP MOUNT;
or
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP FORCE DBA;
  • Run the BACKUP DATABASE command to back up the database to the default backup device
RMAN> BACKUP DATABASE;
or
RMAN> BACKUP AS COPY DATABASE; //creates image copy backups of all data files
  • Open the database and resume normal operations.
RMAN> ALTER DATABASE OPEN;

 

Preparing and Planning Database Restore and Recovery

    1. Determine which database files must be restored from backup, and which backups.
    2. Place the database in the state appropriate for the type of recovery that you are performing. For example, if you are recovering a single tablespace or datafile, then you can keep the database open and take the tablespace or datafile offline. If you are restoring all datafiles, then you must shut down the database and then mount it before you can perform the restore.
    3. Restore lost database files from backup with the RESTORE command.
    4. Perform media recovery on restored datafiles, if any, with the RECOVER command.
    5. Perform any final steps required to make the database available for users again. For example, re-open the database if necessary, or bring offline tablespaces online.
  1. Perform RMAN restore and Recovery
    1. Block media recovery
    2. restore control file
    3. restore SP file
    4. restore and recover entire database
    5. restore and recover tablespace or datafile
    6. restore archive log from backup
  2. reporting with RMAN.
    1. listing backups
    2. reporting datafiles and backup
  3. Monitionirng through V$ views
  4. RMAN scripting and log files
Go to top
JSN Boot template designed by JoomlaShine.com