How to use RMAN in Oracle Database (With Examples)

How to use RMAN in Oracle Database
(With Examples)

Using Oracle RMAN, you can take a hot backup for your database, which will take a consistent backup even when your DB is up and running.
This tutorial gives you an introduction on how to perform Oracle DB backup using RMAN.

For the impatient, here is the quick snippet, that takes RMAN backup of both database and archive logs.
RMAN> BACKUP AS BACKUPSET DATABASE PLUS ARCHIVELOG;

To View Current Configuration of RMAN:

Before we take the backup, we have to configure certain RMAN parameters. For example, how long you want to retain the RMAN backup, etc.
Before we modify any configuration, execute the following command to view all current RMAN configuration settings.
To connect to RMAN, do the following from command line. This will take you to RMAN> command prompt, from here you can execute all RMAN commands.
$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Aug 10 11:21:29 2013
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database: DEVDB (DBID=821773)
RMAN>
To view current RMAN configurations, execute “show all”.

RMAN> SHOW ALL;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE 
DISK TO "/backup/rman/ctl_%F";
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET 
PARALLELISM 2;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT  
 "/backup/rman/full_%u_%s_%p" MAXPIECESIZE 2048 M;
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 
'/u01/app/oracle/product/10.2.0/dbs/snapcf_devdb.f'; # default
As you see above, it displays various RMAN parameters and their current values.


For all RMAN Backup Command visit Below Link:


Ref: http://www.thegeekstuff.com/

Comments