Let us we discuss about Rman incremantal Backup and thier types

What is Rman?

Rman(Recovery Manager) is an Oracle Database client that performs backup and recovery tasks on your database and it automates  the work of backup strategies like backup, restore  and  recovering data files.

It includes the following components

1)target database  

    - A target database is a database on which RMAN is performing backup and recovery operations
  Rman repository
    - Rman maintains the meta data information a database in the control file of the database. the meta  data is known as  “Rman repository”

2)rman client

    - The executable file will automatically  installed  with the database “$ORACLE_HOME/bin”
    - Those commands will  direct to server session  and records its activity in target database control file

Major default storage area:

 1) Flash recovery area – Local disk location which can store backup and recovery files
 2) Media  Manager  - tapes
 3) Recovery Catalog  - A separate database schema is used to record rman activity against one or more target database.

Note: The database may overwrite older records in the control file, but RMAN maintains records forever in the catalog unless the records are deleted by the user.

Typical Backup Options

1)Format  => Backup format  ‘%U_%d_%t_%s_%p’
              Here %U=Unique name ,%d=database name,%t=backup set time stamp,%s=backup set number,%p=backup piece number
 2)TAG => BACKUP TAG 'weekly_full_db_bkup'  DATABASE MAXSETSIZE 10M;
             We are allocating the name of rman Backup   if we don't mention the tag by default the rman allocates the name using date and time


Making Incremental Backup


    - It captures the block level changes to the database after incremental or full backups
    - By generally incremental is smaller and faster than full backup and  Recovery with incremental backups is faster than using redo logs alone.
    - In this incremental backup starting is “Level 0” Which is same as a full backup  but it ll  set  a backup strategy.
    - In “Level 1” backup  which contains only blocks changed after a previous incremental backup , if  our  current database or parent database incarnation doesn’t have the “Level 0” backup we would directly proceed for “Level 1” then it ll take automatically “Level 0”

Types of Incremental  backup

1) Cumulative
   - Which includes all block changes since the most recent level 0 backup  
2) Differential
   - Which includes only blocks changed since the most recent incremental backup. Incremental backups are differential by default.



Differential Incremental Backup
 

C:\Users\Ramakrishnan>rman target /


Recovery Manager: Release 11.2.0.2.0 - Production on Tue May 2 16:34:53 2017
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: DHONI (DBID=2804950687)
 

RMAN> backup format 'Dh_%U_%d_%t_%s_%p'Tag 'Incre_backup_1' incremental level 1
database;

Starting backup at 02-MAY-17
using channel ORA_DISK_1
no parent backup or copy of datafile 4 found
no parent backup or copy of datafile 2 found
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 1 found
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\USERS.DB
F
input datafile file number=00002 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\UNDOTBS1
.DBF
input datafile file number=00003 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSAUX.D
BF
input datafile file number=00001 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.D
BF
channel ORA_DISK_1: starting piece 1 at 02-MAY-17
channel ORA_DISK_1: finished piece 1 at 02-MAY-17
piece handle=C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\DH_3DS38B0S_1
_1_DHONI_942943260_109_1 tag=INCRE_BACKUP_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:18:25
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=D:\REC_CATALOG\REC_CATALOG.DBF
input datafile file number=00006 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\VR.DBF
channel ORA_DISK_1: starting piece 1 at 02-MAY-17
channel ORA_DISK_1: finished piece 1 at 02-MAY-17
piece handle=C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\DH_3ES38C3D_1
_1_DHONI_942944365_110_1 tag=INCRE_BACKUP_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 02-MAY-17
channel ORA_DISK_1: finished piece 1 at 02-MAY-17
piece handle=C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\DH_3FS38C3K_1
_1_DHONI_942944372_111_1 tag=INCRE_BACKUP_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 02-MAY-17


Cumulative Incremental Backup
 

RMAN> backup  format 'Dh_%U_%d_%t_%s_%p' Tag 'Incre_culMul' incremental level 1
cumulative database;


Starting backup at 02-MAY-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\USERS.DB
F
input datafile file number=00002 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\UNDOTBS1
.DBF
input datafile file number=00003 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSAUX.D
BF
input datafile file number=00001 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.D
BF
input datafile file number=00005 name=D:\REC_CATALOG\REC_CATALOG.DBF
input datafile file number=00006 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\VR.DBF
channel ORA_DISK_1: starting piece 1 at 02-MAY-17
channel ORA_DISK_1: finished piece 1 at 02-MAY-17
piece handle=C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\DH_3GS38CF7_1
_1_DHONI_942944743_112_1 tag=INCRE_CULMUL comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 02-MAY-17
channel ORA_DISK_1: finished piece 1 at 02-MAY-17
piece handle=C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\DH_3HS38CH9_1
_1_DHONI_942944809_113_1 tag=INCRE_CULMUL comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-MAY-17

To get over all details summary
 

RMAN> list backup of database summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
75      B  0  A DISK        10-FEB-17       1       1       NO         TAG201702
10T115438
84      B  F  A DISK        02-MAY-17       1       1       NO         TAG201705
02T162002
87      B  1  A DISK        02-MAY-17       1       1       NO         TAG201705
02T163739
90      B  0  A DISK        02-MAY-17       1       1       NO         INCRE_BAC
KUP_1
91      B  1  A DISK        02-MAY-17       1       1       NO         INCRE_BAC
KUP_1
93      B  1  A DISK        02-MAY-17       1       1       NO         INCRE_CUL
MUL


Note: If we are not mentioned tag name the system will generate the “TAG Name”

Backup strategy

We can implement three kinds of backup strategies
1) Level 0 or full backup - Monthly once
2) Level 1 Cumulative -  Weekly Once
3) Level1 Differential -  Daily  Once

Note: if we are going to take level  0 or Full backup a thumb rule is to take a new backup when the data of 50% has been changed. We can observe also by using this query

 

SQL> SELECT FILE#, INCREMENTAL_LEVEL, COMPLETION_TIME, BLOCKS, DATAFILE_BLOCKS FROM V$BACKUP_DATAFILE WHERE INCREMENTAL_LEVEL > 0 AND BLOCKS / DATAFILE_BLOCKS > .5 ORDER BY COMPLETION_TIME; 

 


The  level 0 backup is a  base of The No of block changes in  cumulative or differential backups

Difference Between Cumulative and Differential Incremental Backup

 

 

Cumulative IB Differential IB
Faster restore and occupies more              
disk space
   Faster Backup
all blocks changed since the most     
recent  taken the last full backup
Only changed blocks  which is most recently    taken the  last incremental   backup