High Availbility

OS & Virtualization

Friday, January 20, 2012

Oracle image copy

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.

Backup Procedure
Step 1 : Create a image copy of full database
RUN {
ALLOCATE CHANNEL dbkp1 DEVICE TYPE DISK FORMAT 'D:\oracle\rman\ora10G\U%';
BACKUP AS COPY DATABASE; }

Step 2 : Backup incrementally and restore to the image copy
RUN {
# Roll forward any available changes to image copy files
# From the previous set of incremental Level 1 backups
RECOVER COPY OF DATABASE WITH TAG 'cool';
# Create incremental level 1 backup of all datafiles in the database
# For roll-forward application against image copies
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'cool' DATABASE; }

Restore/recovery procedure
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:
RMAN> alter database mount;
RMAN>switch database to copy;

If you want to restore the database
RMAN > restore database;
RMAN > recover database;

No comments: