RMAN change tracking

Source: Internet
Author: User
The change tracking function of RMAN improves the performance of Incremental backup by recording the changed data blocks in each data file in the change tracking file. If change tracking is enabled, RMAN enables

The change tracking function of RMAN improves the performance of Incremental backup by recording the changed data blocks in each data file in the change tracking file. If change tracking is enabled, RMAN enables

The change tracking function of RMAN improves the performance of Incremental backup by recording the changed data blocks in each data file in the change tracking file. If change tracking is enabled, RMAN uses a change tracking file to identify the data blocks that have changed since the last Incremental backup. This avoids scanning all data blocks of each data file.

After change tracking is enabled, the first Incremental backup at level 0 still scans all data blocks of each data file. At this time, the change tracking file cannot reflect the status of the data block. Subsequent Incremental Backup uses level 0 Incremental backup as the parent backup set so that you can use the change tracking file for Incremental backup.

Using change tracking does not change the command to execute Incremental backup. The change tracking itself usually requires less maintenance after the settings.

Change tracking is disabled by default because it has some minor performance overhead during normal database operations. However, to perform a full scan of data files during the backup, and only a small amount of data blocks change during the two backups, change tracking is useful. If your backup policy uses Incremental backup, you should enable change tracking.

Once a change tracking file is created for the entire database, the directory generated by the change tracking file is
Db_create_file_dest parameter. You can also specify the file name and storage directory of the change trail when you enable the change trail.

Note: In the RAC environment, change tracking files should be stored in shared storage to make all nodes use change tracking files.

Oracle saves enough change tracking files to allow Incremental backup to use the last eight incremental backups as its parent backups.

Although RMAN does not support the backup and recovery of the change tracking file itself, if the database or part of it needs to be restored and restored, the recovery will not affect the change tracking. After restoration and recovery, the change tracking file is cleared and the change of the data block is recorded again. The change tracking data can be used for the next Incremental backup after any restoration.

Enable or disable block change tracking
The Directory of the block change tracking file is set by the db_create_file_dest parameter. The following statement is used to enable the block change tracking:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;


You can also specify the directory created by the block change tracking file when enabling block change tracking.
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
Using file '/mydir/rman_change_track.f' REUSE;


The REUSE option tells Oracle to overwrite the existing block tracking file.

To disable block change tracking:
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;


If the block change tracking file is stored in the database area, it is deleted when the change tracking is disabled.
SQL> alter database enable block change tracking using file '/u01/app/oracle/rman_change_trace.f' reuse;

Database altered.


Check whether a change tracking file is generated
[Root @ oracle11g oracle] # ls-lrt
Total 11632
Drwxr-xr-x 3 oracle oinstall 4096 Sep 5 10.2.0
Drwxrwxr-x 3 oracle oinstall 4096 Sep 5 oradata
Drwxr-x --- 3 oracle oinstall 4096 Sep 5 admin
Drwxrwxr-x 3 oracle oinstall 4096 Sep 5 flash_recovery_area
-Rw-r -- 1 oracle oinstall 226495 Nov 18 utlu112i_8. SQL
-Rw-r -- 1 oracle oinstall 10373 Nov 18 upgrade_info.log
Drwxr-xr-x 3 root 4096 Nov 18 11.2.0
Drwxrwx --- 7 oracle oinstall 4096 Nov 18 oraInventory
Drwxrwxr-x 11 oracle oinstall 4096 Nov 18 diag
Drwxr-xr-x 2 oracle oinstall 4096 Nov 18 checkpoints
Drwxr-x --- 5 oracle oinstall 4096 Nov 19 export toollogs
-Rw-r -- 1 oracle oinstall 3261 Nov 23 upchk. log
-Rw-r -- 1 oracle oinstall 2237 Nov 26 downgrade. log
-Rw-r ----- 1 oracle oinstall 11600384 Jan 26 rman_change_trace.f


Disable block change tracking:
SQL> alter database disable block change tracking;

Database altered.


Check whether the generated change tracking file has been deleted.
[Root @ oracle11g oracle] # ls-lrt
Total 284
Drwxr-xr-x 3 oracle oinstall 4096 Sep 5 10.2.0
Drwxrwxr-x 3 oracle oinstall 4096 Sep 5 oradata
Drwxr-x --- 3 oracle oinstall 4096 Sep 5 admin
Drwxrwxr-x 3 oracle oinstall 4096 Sep 5 flash_recovery_area
-Rw-r -- 1 oracle oinstall 226495 Nov 18 utlu112i_8. SQL
-Rw-r -- 1 oracle oinstall 10373 Nov 18 upgrade_info.log
Drwxr-xr-x 3 root 4096 Nov 18 11.2.0
Drwxrwx --- 7 oracle oinstall 4096 Nov 18 oraInventory
Drwxrwxr-x 11 oracle oinstall 4096 Nov 18 diag
Drwxr-xr-x 2 oracle oinstall 4096 Nov 18 checkpoints
Drwxr-x --- 5 oracle oinstall 4096 Nov 19 export toollogs
-Rw-r -- 1 oracle oinstall 3261 Nov 23 upchk. log
-Rw-r -- 1 oracle oinstall 2237 Nov 26 downgrade. log


SQL> select filename from v $ block_change_tracking;

FILENAME
--------------------------------------------------------------------------------
/U01/app/oracle/rman_change_trace.f

2. Shut down the database.
SQL> shutdown immediate

Database closed.
Database dismounted.
ORACLE instance shut down.


3. Use the operating system command to move the block change tracking file to a new location.
[Root @ oracle11g oracle] # mv rman_change_trace.f rman_change_trace_new.f


4. mount the database and change the block change tracking File
SQL> startup mount
ORACLE instance started.

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.