Oracle 10g Block Change tracking feature

Source: Internet
Author: User

Using Block Change Tracking to Improve Incremental Backup performance

Improve performance of incremental backups with block change tracking

The block change tracking feature to incremental backups improves backup performance by recording changed blocks Data file.

Block change tracking feature improves the performance of incremental backups by recording block changes for each data file

About Block Change Tracking

If block change tracking was enabled on a primary or standby database, then RMAN uses a block change tracking file to ident Ify changed blocks for incremental backups. By reading this small bitmap file to determine which blocks changed, RMAN avoids have to scan every block in the data fi Le that it's backing up.

If block change tracking is enabled in the master or slave database, Rman will use the block to change the tracking file to identify the changed blocks for incremental backups. This bitmap file is read to determine which blocks have been changed, so that Rman avoids scanning all data files for incremental backups.

Block change tracking are disabled by default. Nevertheless, the benefits of avoiding full data file scans during backup is considerable, especially if only a small per Centage of data blocks is changed between backups. If your backup strategy involves incremental backups, then the block change tracking is recommended. Block change Tracking does is the commands used to perform incremental backups. The change tracking file requires no maintenance after initial configuration.

The block Change tracking feature is disable by default. However, the advantages of avoiding full data file scanning during backup are worth considering, especially if only a small percentage of data blocks are changed. If your backup strategy introduces incremental backups, it is recommended that you use the block Change tracking feature. Block change tracking does not change the command that performs an incremental backup. No additional maintenance is required after initialization of the configuration.

You can only enable block change tracking at a physical standby database if a license for the Oracle Active Data Guard opt Ion is enabled.

Space Management in the Block change Tracking File

Block change tracking file space management

The change tracking file maintains bitmaps this mark changes in the datafiles between backups. The database performs a bitmap switch before each backup. Oracle Database automatically manages space in the change tracking file to retain block change data that covers the eight Most recent backups. After the maximum of eight bitmaps is reached, the oldest bitmap are overwritten by the bitmap that tracks the current Chan Ges.

Block change tracking files maintain bitmap information that changes in the data file tag. Oracle automatically manages to change the size of the trace file, retaining the last 8 block change information, more than 8 times, and the oldest bitmap information being overwritten by the new one.

The first Level 0 incremental backup scans the entire data file. Subsequent incremental backups use the block change tracking file to scan only the blocks that has been marked as changed Since the last backup. An incremental backup can optimized if only if it is based on a parent backup this was made after the start of the Oldes T bitmap in the block change tracking file.

The first Level 0 incremental backup scans all of the data files. Subsequent incremental backups use blocks to change the trace file to scan only those blocks that have changed since the last backup.

Consider the EIGHT-BITMAP limit when developing your incremental backup strategy. For example, if-a level 0 database backup followed by seven differential incremental backups and then the Block Chan GE tracking file now includes eight bitmaps. If you and make a cumulative level 1 incremental backup, then RMAN cannot optimize the backup, because the bitmap corresp Onding to the parent level 0 backup is overwritten with the bitmap that tracks the current changes.

Consider the relationship between the 8 limit of change tracking file and the backup policy. If we make 7 different incremental backups after a level 0 backup, then block change tracking contains 8 bitmaps information. If we are doing an incremental 1-level backup, then the increment is not optimal and the entire data file is scanned. Since our previous level 0 bitmap information is covered by our current bitmap information, there is no basis for reference.

So Rman's backup strategy takes into account the impact of this 8-time bitmap.

Location of the Block change Tracking File

Block changes the location of the trace file

One block change tracking file was created for the whole database. By default, the change tracking file is created as a Oracle managed file in the destination specified by the DB_CREATE_FILE_DEST Initia Lization parameter. You can also place the change tracking file in any location that is choose, by specifying it name when enabling block CH Ange tracking. Oracle recommends against using a raw device (that is, a disk without a file system) as a change tracking file.

A block changes the trace file for the entire database, by default, the block changes the trace file as an Oracle management file, under the initialization parameter db_create_file_dest the specified path. You can also specify a name and a custom path when the Enable block changes the tracking feature. Oracle does not recommend using bare devices as blocks to change the location of trace files.

Note:

In a Oracle RAC environment, the change tracking file must is located on GKFX storage accessible from all nodes in the Cluster.

Note that the RAC environment, the block trace files must be placed in the shared storage, all nodes can access

RMAN does not support backup and recovery of the change tracking file. The database resets the tracking file when it determines, the change, tracking file is invalid. If you restore and recover the whole database or a subset, then the database resets the block change tracking file and STA RTS tracking changes again. After your make a level 0 incremental backup, the next incremental backup can use change tracking data.

Rman does not support backup and recovery blocks to change trace files. When the database discovers that the block trace file is invalid, the database resets the block trace file. If you restore the database, the block change trace file is also reset and the record is restarted.

Size of the Block change Tracking File

Block changes the size of the trace file

The size of the block change tracking file was proportional to the size of the database and the number of enabled threads O F Redo. The size of the block change tracking file can increase and decrease as the database changes. The size is a related to the frequency of updates to the database.

Block change the size of the trace file is proportional to the size of the database and the number of threads. The block changes the file to increase or decrease as the database changes. It's okay with the database and the new frequency.

Typically, the space required for block change tracking for a single instance is approximately 1/30,000 the size of the DA Ta blocks to be tracked. For a Oracle RAC environment, it is 1/30,000 of the size of the database, times the number of the enabled threads.

In a typical, single-instance environment, block change tracking files require approximately 1/30,000 of the size of the data block. RAC environment, multiplied by the number of thread

The following factors that could cause the file to being larger than this estimate suggests:

    • To avoid the overhead of allocating space as your database grows, the block change tracking file size starts at Ten Megabyt Es. New space is allocated in MB increments. Thus, for any database up to approximately gigabytes, the file size was no smaller than MB, for up to approximately The file size is no. smaller than megabytes, and so on. gigabytes

    • To avoid exceeding the space, the initial size is 10Mb, and the new space increases by 10MB. For a database of about 300GB, this file size does not exceed 10MB,600GB, not less than 20M, etc.

    • For each data file, a minimum of kilobytes of space are allocated in the block change tracking file, regardless of the Size of the data file. Thus, if you had a large number of relatively small data files, the change tracking file was larger than for databases wit H a smaller number of larger data files containing the same data.

Enabling and disabling Block change Tracking

Enable and disable block change tracking

You can enable block change tracking if the database is either open or mounted. This section assumes, intend to create the block change tracking file as a Oracle Managed file in the database AR EA, which is where the database maintains active database files such as data files, control files, and online redo log fil Es. See "Overview of the Fast Recovery area" to learn on the database area and Fast Recovery area.

To enable block change tracking:

  1. Start Sql*plus and connect to a target database with administrator privileges.

  2. Ensure the DB_CREATE_FILE_DEST initialization parameter is set.

    SHOW PARAMETER Db_create_file_dest
  3. If the parameter is not set, and if the database was open, then you can set the parameter with the following form of the statement:

    ALTER SYSTEM SET   db_create_file_dest = '/disk1/bct/'  scope=both sid= ' * ';
  4. Enable block change tracking.

    Execute the following ALTER DATABASE statement: Execute the following statement to enable the block to change the trace (using the default db_create_file_dest to specify the path)

    ALTER DATABASE ENABLE BLOCK change TRACKING;

    You can also create the change tracking file with a location so you choose yourself by using the following form of SQL STA Tement: You can also customize the block to change the trace file path

    ALTER DATABASE ENABLE BLOCK change TRACKING   USING FILE '/mydir/rman_change_track.f ' reuse;

    The REUSE option tells Oracle Database to overwrite any existing block change tracking file with the specified name. The reuse option is to tell the database to overwrite the existing specified block to change the file

After the Enable block changes the trace, you can see the generated block change tracking file under the path, as well as the background process CTWR.

[Email protected] fff_arch]# Ps-ef | grep CTWR
Oracle 12554 1 0 10:23? 00:00:00 ora_ctwr_fff1
Root 12598 8571 0 10:23 pts/2 00:00:00 grep ctwr

disabling Block change Tracking

This section assumes, the block change tracking feature is currently enabled. When you disable block change tracking, the database removes the block change tracking file from the operating system.

Diable block change tracking, the database will remove the block from the operating system to change the trace file

To disable block change tracking:

    1. Start Sql*plus and connect to a target database with administrator privileges.

    2. Ensure the target database is mounted or open.

    3. Disable block change tracking.

      Execute the following ALTER DATABASE statement:

      ALTER DATABASE DISABLE BLOCK change TRACKING;

Checking Whether Change Tracking is Enabled

You can query the V$BLOCK_CHANGE_TRACKING view to determine whether change tracking are enabled, and if it is, the file name of the block Cha Nge tracking file.

Query V$BLOCK_CHANGE_TRACKING View View block change tracking status and file name

To determine whether change tracking is enabled:

Enter the following query in Sql*plus (sample output included):

COL STATUS   format a8col FILENAME format A60 SELECT STATUS, Filenamefrom   v$block_change_tracking; STATUS   FILENAME--------------------------------------------------------------------ENABLED  /disk1/bct/ Rdbms/changetracking/o1_mf_2f71np5j_.chg

Changing the location of the Block change Tracking File

Move block Change trace file

To move the change tracking file with the ALTER DATABASE RENAME FILE statement. The database must be mounted. The statement updates the control file to refer to the new location and preserves the contents of the Change tracking file . If you cannot shut to the database, then you can disable and enable block change tracking. You lose the contents of the existing block change tracking file.

Move the block to change the trace file, you must use the command in the Mount state ALTER DATABASE RENAME FILE . If not shutdown, then through the first disable, in the Enable method, just will lose the existing block changes the contents of the tracking file. Disable will be deleted along with the tracking file.

The location of the change tracking file:

  1. Start Sql*plus and connect to a target database.

  2. If necessary, determine the current name of the tracking file:

    Sql> SELECT FILENAME from v$block_change_tracking;
  3. If possible, shut down the database. For example:

    Sql> SHUTDOWN IMMEDIATE

    If You shut down the database and then skip to the next step. If you choose don't to shut down the database, then execute the following SQL statements and skip all remaining steps:

    sql> ALTER DATABASE DISABLE BLOCK change TRACKING; sql> ALTER DATABASE ENABLE BLOCK change TRACKING USING FILE ' new_location ';

    In this case you lose the contents of the block change tracking file. Until the next time you complete a level 0 incremental backup, RMAN must scan the entire file.

  4. Using the host operating system commands, move the change tracking file to their new location.

  5. Mount the database and move the change tracking file to a, location, and more space. For example:

    ALTER DATABASE RENAME FILE   '/disk1/bct/rdbms/changetracking/o1_mf_2f71np5j_.chg ' to    '/disk2/bct/rdbms/ Changetracking/o1_mf_2f71np5j_.chg ';

    This statement changes the location of the change tracking file while preserving its contents.

  6. Open the database:

    sql> ALTER DATABASE OPEN;

Summary: Enabling the block change tracking tracking feature increases the performance of the Rman incremental backup, but it also brings some additional overhead, so whether this feature is enabled needs to be considered as a practical consideration.

This article refers to:

[1] http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmbckba.htm#BRADV89551

[2] http://blog.csdn.net/tianlesoftware/article/details/6997647

[3] RMAN 10g:how to Size the Block change Tracking File (Doc ID 306112.1)

Oracle 10g Block Change tracking feature

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.