Monday, February 13, 2006

Why restore before recover? The new Oracle 10g Backup Strategy

Delivering Oracle 10g R2 Administration Workshop II we had a closer look at the new recommended backup strategy for Oracle.

With Oracle 10g R2 we can recover datafile copies like we recover the real datafiles.
This gives us the oportunity to recover the entire database without having to restore it from backup first.
Which of course saves very valuable time in case of a disaster.

Here is how you could do it:

- use a "flash recovery area" to store everything needed for recovering, such as:
- an image copy of the entire database
- one incremental backup of the database
- the archived redo logs which have been created since the last incremental backup

The flash recovery area is a location on disk which you specify by the parameter db_recovery_file_dest. It can be changed dynamically without having to restart.
With the also dynamically changeable parameter db_recovery_file_dest_size you can limit the amount of disk space you want to use for this area.

Once you use it rman will create backupserts and image copies of datafiles there by default.

- create an image copy of the entire database:


This will first search for a parent image copy to recover. If there is none yet, it will create one.
If there is an image copy of the database already, it will create an incremental level 1 backup.

- after you have create the first incremental backup for your image copy you can update these image copies of the datafiles by applying the incremental backup to them.


This is what you do every night.
Then you will have a copy of the database which is always
at least at the level of last night.

In case of a disaster you can now tell rman to just change the locations of the datafiles in the controlfile to the image copies by issuing the following:

You can only do this in MOUNT.
- Now you are already where you were last night and you only have to recover what has changed since last incremental update without having to restore the database at first.

This is a very handy way to perform recovery.
We were able to switch datafiles to copies before 10g already, but could not incrementally update them.


At Thu Apr 20, 04:29:00 PM, Anonymous Anonymous said...

This is a handy tip, Lutz. Is there a way to specify a different location to recover to? In other words, what if you wanted to use the incrementally backed up files to create a clone. Is that possible?

At Fri Apr 21, 02:47:00 PM, Blogger lutz_hartmann said...

Hi anonymous (why anonymous?),
the clou here is that you do not need to restore so why use a different location?
We just save a lot of time with this.

What you are thinking about is possible also:
you can use incremental backups of a production db
and use these to incrementally update a standy db or a clone db.

At Tue Aug 01, 02:55:00 PM, Anonymous Aleksandr_Shubnik said...

Thank you Lutz for laconic explanation, but i want to return to first comment. Can we restore all database from flashback image copy and may be in different location?

At Mon Aug 07, 06:56:00 PM, Blogger lutz_hartmann said...

Hi alexandr,
pls see my email for the comprehensive explanation of this and your other questions.
You get around the restore with a switch databsae to copy and only need to recover after the switch. With this you change the information about the location of the datafiles in the controlfile. It is like a rename of all datafiles in one command.
You basically use one storage for the production and one for the flash recovery area and in case of desaster you just switch to the image copy, which should be incremantally updated every night. Then you only need to recover the changes which were made since the last incremental update of the image copy. No restore!!
Hope this clarifies something.
Keep on switching!

At Mon Aug 14, 02:01:00 PM, Anonymous Anonymous said...

Hi Lutz,

I have taken the backup as suggested by you.

Now I lost my one datafile. can you please tell me how can I recover that datafile using this incremental backup.

I just want to know the steps of recovery please.

with reagrds

At Mon Aug 14, 04:41:00 PM, Blogger lutz_hartmann said...

Hi Anurag,
pls contact me by email and I will get back to you.


Post a Comment

<< Home