Oracle Rman Backup (v) Incremental backup

Source: Internet
Author: User
Tags file copy

Nine Incremental backups

With incremental backups, RMAN allows users to back up only blocks of data that have been modified since the last incremental backup. Incremental backups have the following somewhat:

(1) Less use of disk or tape

(2) Reduce network broadband requirements

(3) Save backup time

You can perform incremental backups in either online or offline mode, Archivelog mode, or Noarchivelog mode. Once you have chosen an incremental backup strategy, you will have a problem with benefits. If you significantly reduce the time of your entire backup operation, you will spend more time on the recovery operation. This is because if an incremental backup strategy is used, Oracle will need to use more backup sets to recover the database, and the time required for recovery will increase significantly.

9.1 Block Change Tracking file

By default, when an incremental backup is performed, all data files that occur with any changes are backed up. This can make incremental backups take longer and increase the size of incremental backups. In 10g, Rman provides the ability to back up only changed blocks of data. This speeds up and reduces the size of incremental database backups. Execute ALTER DATABASE enable block change

The tracking command enables block change tracking.

If you use an Oracle management file (OMF), Oracle will create a block change tracking file. If you do not use OMF, you must define the location and name of the block change tracking file. Such as:

Alter Database enable block change tracking using file ' F:/backup/block.fil ';

If the trace file already exists, you can use the Reuse parameter:

Alter Database enable block change tracking using file ' F:/backup/block.fil ' reuse;

Blocks change tracking can be disabled using the ALTER DATABASE block changes tracking command. The size of the block change tracking file is typically fragmented and related to the size of the database and the number of redo log threads. The size of the block change tracking file is typically 1/30000 of the size of the database. Block change tracking files may grow in increments of 10MB. The minimum size of the block change tracking file is 320k per data file, and if there are many data files, the block change tracking file is larger. Oracle stores enough information in the block change tracking file to allow an incremental backup of up to 8 days. Obviously, if you have an incremental backup of more than 8 days, you will not use block tracking to change the trace file, and you cannot take advantage of the block trace file's somewhat.

You can check the V$block_change_tracking view to determine whether block change tracking is enabled. Status Indicates whether block change tracking is enabled, and filename contains the file name of the block change tracking file. You can transfer block change tracking files through the ALTER DATABASE rename File command.

Sql> select Status,filename from v$block_change_tracking;

STATUS FILENAME

---------- ------------------------------------------------------

ENABLED F:/backup/block.fil

9.2 Basic Backups

When performing an incremental backup operation, you first need an incremental base backup (incremental base backup), and all subsequent incremental backups are based on this basic backup. Each time you perform a database backup operation, you can specify an incremental level identifier for the backup by using the incremental parameter of the backup command. The incremental level of the base backup is 0, and a basic backup is required to perform other types of incremental backup operations. If you try to perform an incremental backup operation without generating a basic backup, Rman automatically performs the basic backup operation. Example:

Backup incremental level=0 database;

9.3 Differential and incremental backups

9.3.1 Differential Backup

Differential backups are the default type of incremental backups that Rman generates, and for differential backups, Rman backs up data blocks that have changed since the last sibling or low-level differential incremental backup.

Backup incremental level=1 database;

9.3.2 Cumulative Backup

A cumulative backup enables backup sets to back up all previous levels of backups and all the changed blocks of data that are to be backed up this time. Cumulative backups are an optional backup method and require the use of the cumulative keyword in the backup command.

Backup Incremental level =2 cumulative database;

9.3.3 Incremental Backup options

Oracle not only allows incremental backups of the database, but also allows for incremental backup operations of tablespaces, data files, and copies of database files. Control files, archive redo logs, and backup sets cannot generate incremental backups. In addition, you can back up the archived redo logs while performing an incremental backup operation.

Backup incremental level=0 tablespace users;

Backup incremental level=1 tablespace users;

Backup incremental level=0 datafile 4;

Backup incremental level=1 datafile 4;

Backup incremental level=1 database plus archivelog;

9.3.4 Incremental Backup Update backup

RMAN provides an incremental backup update backup. This backup avoids the overhead of backing up with a full image copy of the data file and has the same recovery characteristics as the image copy. In a sense, this kind of backup is similar to an incremental backup using an image copy.

run{

Recover copy of database with tag ' ORCL ';

Backup Incremental Level 1 to recover of copy with tag ' ORCL ' database;

}

The Recover of Copy Database command in the example does not have a real recovery database, but it causes Rman to apply any incremental backups to the data file copy associated with the list tag (ORCL).

When you run the command for the first time, it will have no effect because it does not have any incremental backups or copies of the data files available. This is not a serious problem, and Rman will display only one warning message. The second time you run the command, there is no effect because no incremental backups are available.

After the recover command is executed, an incremental backup is generated, which creates a basic backup (if not) the first time the backup is run. This actually increases to 1 of the backup. The second time the run code block is executed, the first incremental backup is performed through the backup command.

Once the command has been run 2 times, the third execution and subsequent execution will be able to apply the previous incremental backup to the data file copy. Note that it is important to give the tag the same name in the Recover and backup commands.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.