In this article we will enable block change tracking
Now, what is block change tracking?
Block change tracking is a mechanism of Oracle database to record changed blocks in a file. It helps us in taking incremental backups. While tracking incremental backups, instead of scanning all datafiles for changed blocks RMAN can simply read change tracking file and can take backup accordingly.
Step 1: Connect to the target database and enable block change tracking using ENABLE BLOCK CHANGE TRACKING command.
[oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Thu Jan 3 11:58:46 2019 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> alter database enable block change tracking; Database altered.
Step 2: Now lets us see the effect here.
Take incremental level 0 backup :
RMAN> backup incremental level 0 database; Starting backup at 03-JAN-19 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=/u02/oradata/DEMO/datafile/o1_mf_system_g2v3h4nx_.dbf input datafile file number=00003 name=/u02/oradata/DEMO/datafile/o1_mf_sysaux_g2v3kjm5_.dbf input datafile file number=00004 name=/u02/oradata/DEMO/datafile/o1_mf_undotbs1_g2v3lxr9_.dbf input datafile file number=00007 name=/u02/oradata/DEMO/datafile/o1_mf_users_g2v3lywc_.dbf channel ORA_DISK_1: starting piece 1 at 03-JAN-19 channel ORA_DISK_1: finished piece 1 at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/backupset/2019_01_03/o1_mf_nnnd0_TAG20190103T120003_g2vbzd3c_.bkp tag=TAG20190103T120003 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:06 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=00010 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_sysaux_g2v4j0p1_.dbf input datafile file number=00009 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_system_g2v4j0j1_.dbf input datafile file number=00011 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_undotbs1_g2v4j0p2_.dbf input datafile file number=00013 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_tbs_rcat_g2v5zj00_.dbf input datafile file number=00012 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_users_g2v4mrlj_.dbf channel ORA_DISK_1: starting piece 1 at 03-JAN-19 channel ORA_DISK_1: finished piece 1 at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/7E8758AC5ED126B4E055000000000001/backupset/2019_01_03/o1_mf_nnnd0_TAG20190103T120003_g2vc1fo4_.bkp tag=TAG20190103T120003 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35 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=00006 name=/u02/oradata/DEMO/datafile/o1_mf_sysaux_g2v3ot3q_.dbf input datafile file number=00005 name=/u02/oradata/DEMO/datafile/o1_mf_system_g2v3ot3x_.dbf input datafile file number=00008 name=/u02/oradata/DEMO/datafile/o1_mf_undotbs1_g2v3ot45_.dbf channel ORA_DISK_1: starting piece 1 at 03-JAN-19 channel ORA_DISK_1: finished piece 1 at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/7E872A11804F1BADE055000000000001/backupset/2019_01_03/o1_mf_nnnd0_TAG20190103T120003_g2vc2kkk_.bkp tag=TAG20190103T120003 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26 Finished backup at 03-JAN-19 Starting Control File and SPFILE Autobackup at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/autobackup/2019_01_03/o1_mf_s_996580932_g2vc3f6j_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 03-JAN-19
Step 3: I am changing blocks of data files by inserting some records in a table
SQL> insert into jagruti select * from jagruti; 128 rows created. SQL> commit; Commit complete.
Step 4: Take an incremental level 1 backup.
RMAN> backup incremental level 1 database; Starting backup at 03-JAN-19 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=/u02/oradata/DEMO/datafile/o1_mf_system_g2v3h4nx_.dbf input datafile file number=00003 name=/u02/oradata/DEMO/datafile/o1_mf_sysaux_g2v3kjm5_.dbf input datafile file number=00004 name=/u02/oradata/DEMO/datafile/o1_mf_undotbs1_g2v3lxr9_.dbf input datafile file number=00007 name=/u02/oradata/DEMO/datafile/o1_mf_users_g2v3lywc_.dbf channel ORA_DISK_1: starting piece 1 at 03-JAN-19 channel ORA_DISK_1: finished piece 1 at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/backupset/2019_01_03/o1_mf_nnnd1_TAG20190103T120329_g2vc5sno_.bkp tag=TAG20190103T120329 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 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=00010 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_sysaux_g2v4j0p1_.dbf input datafile file number=00009 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_system_g2v4j0j1_.dbf input datafile file number=00011 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_undotbs1_g2v4j0p2_.dbf input datafile file number=00013 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_tbs_rcat_g2v5zj00_.dbf input datafile file number=00012 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_users_g2v4mrlj_.dbf channel ORA_DISK_1: starting piece 1 at 03-JAN-19 channel ORA_DISK_1: finished piece 1 at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/7E8758AC5ED126B4E055000000000001/backupset/2019_01_03/o1_mf_nnnd1_TAG20190103T120329_g2vc5ttp_.bkp tag=TAG20190103T120329 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 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=00006 name=/u02/oradata/DEMO/datafile/o1_mf_sysaux_g2v3ot3q_.dbf skipping datafile 00006 because it has not changed input datafile file number=00005 name=/u02/oradata/DEMO/datafile/o1_mf_system_g2v3ot3x_.dbf skipping datafile 00005 because it has not changed input datafile file number=00008 name=/u02/oradata/DEMO/datafile/o1_mf_undotbs1_g2v3ot45_.dbf skipping datafile 00008 because it has not changed channel ORA_DISK_1: backup cancelled because all files were skipped Finished backup at 03-JAN-19 Starting Control File and SPFILE Autobackup at 03-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/autobackup/2019_01_03/o1_mf_s_996581013_g2vc5y6w_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 03-JAN-19 RMAN>
We can see in above output CDB level backup completed in 00:00:01 time and pdb backup skipped as we have not changed any data block on pdb level.
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Telegram Channel: https://t.me/helporacle
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp