Search This Blog

Saturday, May 10, 2008

RMAN versus User Managed Backup-Part-I

We have two ONLINE backup options for taking Oracle database backup
RMAN
User Managed

Both options are needed ARCHIVELOG mode to take ONLINE database backup.

But why Oracle recommended using RMAN to take oracle database backup?
Because there is too many other option for database backup which are not exist in User Managed or if I say we can’t use those options with User Managed backup.

Many of newbie is scare about RMAN (Recovery Manager) backup procedure and thinking it is too complicated but actually it is not.

How we take ONLINE database backup through User Managed method?

SQL> alter database begin backup;

Database altered.

SQL> ---copy all datafiles to backup location
SQL> alter database end backup;

Database altered.

SQL> --switch logfile
SQL> alter system switch logfile;

SQL> --create controlfile backup
SQL> alter database backup controlfile to 'e:\backup\control01.ctl';

Database altered.

SQL> --create spfile backup
SQL> create pfile='e:\backup\init.ora' from spfile;

File created.

NOW user managed backup is complete.

For above 5 steps we need to create scripts and run it.
We can also use above 5 steps through RMAN with single command and take database backup

RMAN> configure controlfile autobackup on;
RMAN> configure controlfile autobackup format for device type disk to 'e:\backup
\%F';

RMAN> run
2> {
3> backup database format 'e:\backup\%U';
4> SQL 'alter system switch logfile';
5> backup archivelog all delete input format 'e:\backup\%U';
6> }

Now RMAN backup is complete.

Just above command will take database backup and also DELETE all archivelog file which are backed up.


Advantage of RMAN

  1. We no need to COPY data files manually to backup location
  2. We can directly take/transfer backup on TAPE drive.
  3. We don’t put database in backup mode
  4. We can take backup in single RUN command
  5. RMAN is fast then User Managed backup
  6. RMAN also take backup of archivelog and delete all archivelog which backed up.
  7. We no need to take backup of spfile or controlfile separately RMAN will take backup of both.


Continue with PART-II

3 comments:

Babu said...

Nice post tah.

Good.

Regards,
Babu

Anonymous said...

A very intelligent post !
Thanks a lot .

Anonymous said...

PERFECT !!!!
it would be nice if you give restore and recover mechanism for both types