PURPOSE
-------
This article discusses the Oracle 10g new feature called 'block change tracking'
and how it helps accelerate RMAN incremental backups.
SCOPE & APPLICATION
-------------------
This article is intended for DBAs and Support Engineers.
Fast Incremental Backups using the Block Change Tracking feature is only available in Enterprise Edition.
http://download-uk.oracle.com/docs/cd/B19306_01/license.102/b14199/editions.htm#CJACGHEB
RMAN 10G FAST INCREMENTAL BACKUPS
----------------------------------
An incremental backup backups up only those blocks that have changed since a previous backup.
Incremental backups have provided the following benefits:
1. Reduced disk space usage (smaller backup-pieces generated)
2. Somewhat faster backup completion times – Even though the number
of blocks eventually written to the backup-piece were less, Oracle
still had to read all the blocks to determine if they changed or not.
Oracle 10g offers a new feature, called block change tracking.
This feature allows for faster creation of incremental backups.
Changes to the database blocks are now tracked using a ‘tracking file’.
When the block change tracking is enabled, Oracle logs changes to the blocks
in this tracking file. During the incremental backup, RMAN reads the tracking
file to determine changed blocks. This obviates the need to read each and
every block in a datafile and thus results in faster incremental backups.
== Enabling block change tracking ==
Block change tracking can be enabled by using the ALTER DATABASE command.
For example:
SQL> alter database enable block change tracking
using file ‘/u01/oradata/orcl/change_tracking.f’;
RESUSE clause can be specified if the file already exists.
SQL> alter database enable block change tracking
using file ‘/u01/oradata/orcl/change_tracking.f’ resuse;
Alternatively, if you have the DB_CREATE_FILE_DEST parameter set (for Oracle Managed Files),
then you can simply issue:
SQL> alter database enable block change tracking;
In this case, Oracle crates an Oracle Managed File (OMF) in the directory specified by
DB_CREATE_FILE_DEST to keep track of block changes.
If DB_CREATE_FILE_DEST is not set and you do not specify a file name,
following error will result:
ORA-19773: must specify change tracking file name
== Disabling block change tracking ==
Block change tracking can be disabled by using the ALTER DATABASE command.
For example:
SQL> alter database disable block change tracking.
This command also removes the change tracking file.
== Determining if block change tracking is enabled ==
Information about block change tracking and the tracking file is stored in the
controlfile and can be accessed using the V$BLOCK_CHANGE_TRACKING view:
SQL> desc v$block_change_tracking
Name Null? Type
------------------- -------------- ------------------
STATUS VARCHAR2(10)
FILENAME VARCHAR2(513)
BYTES NUMBER
This view always contains one record. If the STATUS is ENABLED, then the FILENAME
contains the name of the file being used for tracking and BYTES contains the size
of the file. If the STATUS is DISABLED, the other two columns are null.
The V$BACKUP_DATAFILE view contains a column called USED_CHANGE_TRACKING.
A value of YES for this column for an incremenat backup level > 0 means that RMAN used
the tracking file to speed up the incremental backup. This can help you determine how effective
the the tracking file in minimizing the I/O activity during an incremental backup. The following
query can be used:
select file#,
avg(datafile_blocks),
avg(blocks_read),
avg(blocks_read/datafile_blocks) * 100 as “% read for backup”
from v$backup_datafile
where incremental_level > 0
and used_change_tracking = ‘YES’
group by file#
order by file#;
== Other information ==
o Whenever block change tracking is enabled or disabled, a message is logged into
alert.log to indicate the creation or removal of the tracking file.
o Tracking file can be renamed using ‘alter database rename file’ comamnd.
o Tracking file is a binary file.
o RMAN does not support the backup and recovery of the tracking file.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/104152/viewspace-140018/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/104152/viewspace-140018/