RMAN change tracking

Source: Internet
Author: User

RMAN change tracking

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.

Total System Global Area 327155712 bytes
Fixed Size 1273516 bytes
Variable Size 138412372 bytes
Database Buffers 184549376 bytes
Redo Buffers 2920448 bytes
Database mounted.
SQL> alter database rename file '/u01/app/oracle/rman_change_trace.f' to '/u01/app/oracle/rman_change_trace_new.f ';

Database altered.


5. Open the database
SQL> alter database open;

Database altered.

SQL> alter database disable block change tracking;

Database altered.

[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


If you cannot close the database, you must disable change tracking and then specify a new directory when re-enabling. For example:
Alter database disable block change tracking;
Alter database enable block change tracking using file 'new _ location ';


If you choose to use this method, the content in the trace file will be lost. RMAN will have to scan the entire file until you complete the level 0 Incremental Backup next time.

Evaluate and change the tracking File Size
Changing the tracking file size is proportional to the database size and the number of redo log threads. Its size is not related to frequent database updates. Generally, the size of the block change tracking space is 1/30000 of the size of the data block to be tracked. Note: However, the following two reasons may make the change tracking file much larger than the evaluated size:
1. In order to avoid the overhead of allocating space for the change tracking file as the database grows, it is 10 MB at the beginning of the change tracking file creation and the size increases by 10 MB. Therefore, for any database with a size close to GB, the size of the change tracking file should not be less than 10 MB. For databases with a size close to GB, the size of the change tracking file should not be less than 20 mb, and so on.

2. For each data file, regardless of the number of metropolis of the change tracking file, a K space will be allocated in the change tracking file. Therefore, if a large number of small data files exist, the change tracking file will be larger than the change tracking file corresponding to a small number of big data files containing the same amount of data.

-------------------------------------- Recommended reading --------------------------------------

RMAN: Configure an archive log deletion policy

Basic Oracle tutorial-copying a database through RMAN

Reference for RMAN backup policy formulation

RMAN backup learning notes

Oracle Database Backup encryption RMAN Encryption

-------------------------------------- Split line --------------------------------------

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.