RMAN : Incremental : BCT (Block Change tracking)

Q:> What is BCT ?
Sol : Block changing tracking improves the performance of incremental backups by recording changed blocks in the block change tracking file. During an incremental backup, instead of scanning all data blocks to identify which blocks have changed, RMAN uses this file to identify the changed blocks that need to be backed up.



You can enable block change tracking when the database is either open or mounted. This section assumes that you intend to create the block change tracking file as an Oracle Managed File in the database area, which is where the database maintains active database files such as data files, control files, and online redo log files.

To determine if block change tracking is enabled, check the STATUS and FILENAME columns in the V$BLOCK_CHANGE_TRACKING view, using the following statement from the SQL or RMAN prompt:

SELECT status, filename FROM V$BLOCK_CHANGE_TRACKING;
To enable block change tracking:

Connect RMAN to the target database as described in "Connecting to the Target Database Using RMAN."
Determine the current location of the database data files by submitting the following query:
RMAN> SELECT NAME FROM V$DATAFILE;

NAME
-----------------------------------------------
/u01/app/oracle/oradata/orcl/system01.dbf
/u01/app/oracle/oradata/orcl/example01.dbf
/u01/app/oracle/oradata/orcl/sysaux01.dbf
/u01/app/oracle/oradata/orcl/undotbs01.dbf
/u01/app/oracle/oradata/orcl/users01.dbf
In this example, the query results show that data files are stored in the file system in the directory /u01/app/oracle/oradata/orcl. Data files might also be stored in an Oracle Automatic Storage Management disk group.

Set the DB_CREATE_FILE_DEST initialization parameter to specify the location where new database files, including the block change tracking file, must be stored. You can specify the same directory shown in query results from the previous step, with the final portion of the path—the database SID—stripped, as shown in the following example, or designate a new directory. Any directory that you specify must have the write permission for the Oracle software owner.
The following command specifies that new database files must be stored in the directory /u01/app/oracle/oradata/:

ALTER SYSTEM SET DB_CREATE_FILE_DEST = '/u01/app/oracle/oradata';
Enable block change tracking for the database using the following command:
ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;



STEPS : 


SQL> select STATUS,FILENAME from v$block_change_tracking;
STATUS
----------
FILENAME
--------------------------------------------------------------------------------
DISABLED


SQL> alter database enable block change tracking using file '/home/oracle/bct_oracle.dbf';
Database altered.
SQL> select STATUS,FILENAME from v$block_change_tracking;
STATUS
----------
FILENAME
--------------------------------------------------------------------------------
ENABLED
/home/oracle/bct_oracle.dbf



Taking level 0 Backup :

RMAN> backup incremental level 0 database;
Starting backup at 11-JAN-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oraclebase/oradata/testdb2/system01.dbf
input datafile file number=00002 name=/u01/app/oraclebase/oradata/testdb2/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oraclebase/oradata/testdb2/example01.dbf
input datafile file number=00003 name=/u01/app/oraclebase/oradata/testdb2/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oraclebase/oradata/testdb2/rmantest.dbf
input datafile file number=00007 name=/u01/app/oraclebase/oradata/testdb2/bcorrupt.dbf
input datafile file number=00004 name=/u01/app/oraclebase/oradata/testdb2/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_nnnd0_TAG20180111T142342_f5g9jpxw_.bkp tag=TAG20180111T142342 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
Finished backup at 11-JAN-18
Starting Control File and SPFILE Autobackup at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/autobackup/2018_01_11/o1_mf_s_965139918_f5g9mphg_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 11-JAN-18


Taking Level 1 Incremental Differential backup using RMAN (Now faster) :

RMAN> backup incremental level 1 database plus archivelog;
Starting backup at 11-JAN-18
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=11 RECID=7 STAMP=964552269
input archived log thread=1 sequence=12 RECID=8 STAMP=964552320
input archived log thread=1 sequence=13 RECID=9 STAMP=964552532
input archived log thread=1 sequence=14 RECID=10 STAMP=964616339
input archived log thread=1 sequence=15 RECID=11 STAMP=964616711
input archived log thread=1 sequence=16 RECID=12 STAMP=964616807
input archived log thread=1 sequence=17 RECID=13 STAMP=964617524
input archived log thread=1 sequence=18 RECID=14 STAMP=964617637
input archived log thread=1 sequence=19 RECID=15 STAMP=964629021
input archived log thread=1 sequence=20 RECID=16 STAMP=964629089
input archived log thread=1 sequence=21 RECID=17 STAMP=964638846
input archived log thread=1 sequence=22 RECID=18 STAMP=964915288
input archived log thread=1 sequence=23 RECID=25 STAMP=964973347
input archived log thread=1 sequence=24 RECID=26 STAMP=964973347
input archived log thread=1 sequence=25 RECID=24 STAMP=964973345
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_annnn_TAG20180111T142725_f5g9qox1_.bkp tag=TAG20180111T142725 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=32 STAMP=964976735
input archived log thread=1 sequence=2 RECID=33 STAMP=964976735
input archived log thread=1 sequence=3 RECID=34 STAMP=964976735
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_annnn_TAG20180111T142725_f5g9r56o_.bkp tag=TAG20180111T142725 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=40 STAMP=964986275
input archived log thread=1 sequence=2 RECID=41 STAMP=964986275
input archived log thread=1 sequence=3 RECID=42 STAMP=964986275
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_annnn_TAG20180111T142725_f5g9r69v_.bkp tag=TAG20180111T142725 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=46 STAMP=965004744
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_annnn_TAG20180111T142725_f5g9r7f4_.bkp tag=TAG20180111T142725 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=47 STAMP=965140045
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_annnn_TAG20180111T142725_f5g9r8jk_.bkp tag=TAG20180111T142725 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-JAN-18
Starting backup at 11-JAN-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oraclebase/oradata/testdb2/system01.dbf
input datafile file number=00002 name=/u01/app/oraclebase/oradata/testdb2/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oraclebase/oradata/testdb2/example01.dbf
input datafile file number=00003 name=/u01/app/oraclebase/oradata/testdb2/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oraclebase/oradata/testdb2/rmantest.dbf
input datafile file number=00007 name=/u01/app/oraclebase/oradata/testdb2/bcorrupt.dbf
input datafile file number=00004 name=/u01/app/oraclebase/oradata/testdb2/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_nnnd1_TAG20180111T142745_f5g9r9vj_.bkp tag=TAG20180111T142745 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-JAN-18
Starting backup at 11-JAN-18
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=48 STAMP=965140067
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_annnn_TAG20180111T142747_f5g9rccc_.bkp tag=TAG20180111T142747 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-JAN-18
Starting Control File and SPFILE Autobackup at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/autobackup/2018_01_11/o1_mf_s_965140068_f5g9rf6p_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 11-JAN-18


Taking Level 1 Incremental Cumulative backup using RMAN (Now faster) :

RMAN> backup incremental level 1 cumulative database plus archivelog;
Starting backup at 11-JAN-18
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=47 STAMP=965140045
input archived log thread=1 sequence=2 RECID=48 STAMP=965140067
input archived log thread=1 sequence=3 RECID=49 STAMP=965140108
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_annnn_TAG20180111T142828_f5g9sn81_.bkp tag=TAG20180111T142828 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-JAN-18
Starting backup at 11-JAN-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oraclebase/oradata/testdb2/system01.dbf
input datafile file number=00002 name=/u01/app/oraclebase/oradata/testdb2/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oraclebase/oradata/testdb2/example01.dbf
input datafile file number=00003 name=/u01/app/oraclebase/oradata/testdb2/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oraclebase/oradata/testdb2/rmantest.dbf
input datafile file number=00007 name=/u01/app/oraclebase/oradata/testdb2/bcorrupt.dbf
input datafile file number=00004 name=/u01/app/oraclebase/oradata/testdb2/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_nnnd1_TAG20180111T142829_f5g9somt_.bkp tag=TAG20180111T142829 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-JAN-18
Starting backup at 11-JAN-18
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=50 STAMP=965140110
channel ORA_DISK_1: starting piece 1 at 11-JAN-18
channel ORA_DISK_1: finished piece 1 at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/backupset/2018_01_11/o1_mf_annnn_TAG20180111T142830_f5g9spp3_.bkp tag=TAG20180111T142830 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-JAN-18
Starting Control File and SPFILE Autobackup at 11-JAN-18
piece handle=/u01/app/oraclebase/fast_recovery_area/TESTDB2/autobackup/2018_01_11/o1_mf_s_965140111_f5g9srgs_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 11-JAN-18


No comments:

Post a Comment