High Availbility

OS & Virtualization

Saturday, January 28, 2012

Oracle incremental update using image copy

Explains the RMAN Image copy feature and incrementally updated backups New in Oracle 10G.

• Rman is configured with Recovery Catalog.
• Recovery Catalog Database Name-Orcl
• Database Name test is taken for demo
• Database Test is Running in no archive log mode
• Configured Backup location is 'D:\ORACLE\RMAN\ORA10G'
• During the first and second run of the backup scripts I made some changes in the Database. Also during the second and the third run I made some changes in the Database.


Expanded Image Copying Features: A standard RMAN backup set contains one or more backup pieces, and each of these pieces consists of the data blocks for a particular datafile stored in a special compressed format. When a datafile needs to be restored, therefore, the entire datafile essentially needs to be recreated from the blocks present in the backup piece.


An image copy of a datafile, on the other hand, is much faster to restore because the physical structure of the datafile already exists. Oracle 10g now permit image copies to be created at the database, tablespace, or datafile level through the new RMAN directive BACKUP AS COPY. For example, here is a command script to create image copies for all datafiles in the entire database:
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: