---------- Full backup -----------
Backup set: block backup used in data files
Image copy: a complete copy of all data files.
---------- Incremental Backup -----------
A backup of a database that has changed since a specific time point. This time point can be the time point of the last (full or incremental) backup.
The format of files generated by Incremental Backup can only be backup set. RMAN can only perform Incremental backup on data files, and control files and parameter files cannot be incrementally backed up.
Advantages of Incremental Backup;
1. when the media is restored, the data in the backup set is directly used to overwrite the data block content in the data file. If archive logs are used for recovery, the steps are complicated, incremental backup is much faster than archiving logs.
2. Incremental Backup can capture the data changes of nologging operations, which are not recorded in logs. Therefore, Incremental Backup can provide more data protection than only backing up archived logs.
I. Full backup
The backupset format is used by default.
RMAN> backup database;
RMAN> Backup as compressed backupset database;
Image copy backup:
RMAN> Backup as copy database;
Example of full backup:
Run
{
Configure controlfile autobackup on;
Configure controlfile autobackup format device type disk to '/u01/RMAN/control/auto_control _ % F ';
Backup as copy db_file_name_convert = ('+ data1/prod',/u01/RMAN/data') database;
}
Note: When using image copy for backup, if you want to create a backup file in the specified directory with the same name as the original data file, you can specify db_file_name_convert before database/datafile
However, if you want to back up the data files on ASM to ASM, this method may fail. Cause: by default, ASM uses the OMF method to manage data files. The data file names generated by the OMF method are in the following format:
In tag_name.file_number.incarnation_number format, incarnation_number cannot be manually specified. To solve this problem, we should choose not to use the OMF Method When configuring ASM.
Ii. Incremental Backup Principle
Incremental Backup only backs up changed data blocks. Oracle uses ORACLE data blocks as the basic storage unit. Each data block header contains SCN, which indicates the latest SCN. Incremental Backup reads the SCN of each data block header,
Compared with the checkpoint SCN of the last backup, if the SCN of the data block header is greater than or equal to the checkpoint SCN, the data block is also locked, RMAN copies the data block and stores it in the backup file.
Before Oracle 10 Gb, Oracle allows multi-level Incremental backup. in Oracle 10 Gb, only 0 and 1 Incremental Backup are allowed. 0 is equivalent to full backup, however, full backup cannot be zero-level Incremental backup.
Advantages of Incremental Backup: accelerate recovery and reduce data loss.
1. Differential Incremental Backup)
Sunday, Monday, Wednesday, Friday, Sunday
0 1 1 1 1 0
Monday is a change since Sunday
Tuesday is a change since Monday
Wednesday is a change since Tuesday
RMAN> Backup incremental level 0 database;
RMAN> Backup incremental Level 1 database;
2. Cumulative icremental backup)
Sunday, Monday, Wednesday, Friday, Sunday
0 1 1 1 1 0
Monday is a change since Sunday: Sunday-Monday
Tuesday: Sunday-Monday, Monday-Tuesday
Wednesday: Sunday-Monday, Monday-Tuesday-Wednesday
RMAN> Backup incremental Level 1 Cumulative database;
Example:
Level 0 backup
Run
{
Backup as copy of db_file_convert ('+ data1/prod','/u01/RMAN/datafile') incremental level 0 database tag 'full _ backup ';
}
Level 1 backup
Run
{
Backup incremental Level 1 Cumulative for recover of copy with Tag 'full _ backup' database;
Recover copy of database with Tag 'full _ backup ';
}
3. Block change tracking
Traditional Incremental Backup: in order to obtain the data blocks to be backed up (changed blocks), all data blocks need to be traversed, resulting in low backup efficiency.
Block change tracking file: when the data block changes, the relevant information is recorded in this file. When using RMAN for Incremental backup, you do not need to traverse all data blocks. You can directly obtain the changed data blocks from this file.
Backing up the data block list can greatly improve the backup efficiency.
Enable block change tracking
SQL> alter database enable block change tracking;
Database altered.
I am original, reprinted please indicate the source
Disable block change tracking
SQL> alter database disable block change tracking;
Database altered.
If no trace file is specified when the trace file is enabled, the default trace file is located:
SQL> Col filename for a45
SQL> select * from V $ block_change_tracking;
Status filename bytes
-----------------------------------------------------------------
Enabled + data1/Prod/changetracking/ctf.271.789029981 11599872
After block change tracking is enabled, Oracle starts a ctwr process to track data block changes. You can manually specify the location of the tracking file:
SQL> alter database enable block change tracking using File '/u01/RMAN/block_changing.track ';
Database altered.
For reprint, please indicate the source and original article links:
Http://blog.csdn.net/xiangsir/article/details/8577157