生产环境Oracle 11g 数据库全备是4小时,增量备份需要2小时??? 那么如何加快周一至周六的增量备份速度,减少备份时间呢?
使用Oracle 块跟踪,开启后,备份时跳过无需备份的信息,只需要根据块跟踪文件记录改变了的blocks进行备份,加快备份扫描的速度!
从如下测试可以发现测试环境
全库备份826Mb需要4分钟时间,增量1级差异备份需要2分钟???如果启用块跟踪后,增量1级差异备份只需要5s当时是没有数据,真实时间速度也很快。
http://blog.itpub.net/31397003/viewspace-2636387/ 差异与累计备份区别参考链接
SQL> select sum(bytes)/1024/1024/1024 from dba_segments; SUM(BYTES)/1024/1024/1024 ------------------------- 1.68725586 alter session set nls_date_format='YYYY-MM-DD:HH24:MI:SS'; backup as compressed backupset database include current controlfile format '/bak/FULLBAK_%U_%d_%s_not.bak'; Starting backup at 2020-05-07 05:04:01 Finished Control File and SPFILE Autobackup at 2020-05-07 05:08:36 826Mb =>4Min:35s 由于全备无法作为增量备份使用!需要重新进行数据库全备 backup incremental level 0 as compressed backupset database format '/bak/full_%d_%T_%t_%s_%p'; Starting backup at 2020-05-07 05:09:33 Finished Control File and SPFILE Autobackup at 2020-05-07 05:12:42 824Mb=>3Min:10s backup incremental level 1 as compressed backupset database format '/bak/full_%d_%T_%t_%s_%p'; Starting backup at 2020-05-07 05:13:38 Finished Control File and SPFILE Autobackup at 2020-05-07 05:15:21 1Mb=>2min == SQL> alter database enable block change tracking using file '+DATA' reuse; SQL> select status,filename from v$block_change_tracking; STATUS FILENAME ---------- ----------------------------------------------------------------- ENABLED +DATA/ORCL/CHANGETRACKING/ctf.324.1039756611 RMAN> alter session set nls_date_format='YYYY-MM-DD:HH24:MI:SS'; RMAN> backup incremental level 0 as compressed backupset database format '/bak/full_%d_%T_%t_%s_%p'; Starting backup at 2020-05-07 05:18:31 Finished Control File and SPFILE Autobackup at 2020-05-07 05:22:20 825Mb=>4Min RMAN> backup incremental level 1 as compressed backupset database format '/bak/full_%d_%T_%t_%s_%p'; Starting backup at 2020-05-07 05:27:14 Finished Control File and SPFILE Autobackup at 2020-05-07 05:27:19 1Mb=>5s