测试incremental backup时间
incremental backup在没有打开block change tracking的情况下将扫描所有数据文件,将指定SCN号后有change的block写入备份文件中。
当physical standby数据库落后primary database并且archive log丢失的情况下可用于恢复standby数据库。
简单步骤如下:
1. 查看目前standby数据库recover到了哪个SCN
standby> alter database recover managed standby database cancel;
standby> select current_scn from v$database;
2. 在primary数据库上做incremental backup
prmary> rman target /
primary> backup incremental from scn xxxx database format ‘/dir/ForStandby_%U’ tag ‘FOR STANDBY’;
3. 将备份的文件copy到standby数据库
4. 在primary上生成standby controlfile,并将其copy到standby database
primary> alter database create standby controlfile as ‘/tmp/stby.ctl’;
5. shutdown standby database,使用新的control file startup,如果有文件名不同,需要rename datafile
如果有新文件在standby apply后生成的,需要create datafile
SQL> alter database create datafile
as ‘ ‘;
6. 在standby上面应用incremental backup set
RMAN> CATALOG START WITH ‘/tmp/ForStandby’;
RMAN> RECOVER DATABASE NOREDO;
我在一3.6TB的数据库上(存储为HDS 9990)大略测试了下incremental backup的时间:
SQL> select sum(bytes)/power(1024,4)|| from v$datafile;
SUM(BYTES)/POWER(1024,4)
————————
3.640852
1. noparallel
RMAN> BACKUP INCREMENTAL FROM SCN 3561046270000 database format ‘/backup/ForStandby_%U’ tag ‘FOR STANDBY’;
Starting backup at 2009-09-18 08:40:22
Finished backup at 2009-09-18 14:25:54– 5 hour 54 minutes
2. parallel 4
run
{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
BACKUP INCREMENTAL FROM SCN 3561046383893 database format ‘/backup/ForStandby2nd_%U’ tag ‘FOR STANDBY’;
}Starting backup at 2009-09-21 23:38:57
Finished backup at 2009-09-22 03:04:39– 3 hour 26 minutes
3. prallel 8
run
{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate channel ch5 type disk;
allocate channel ch6 type disk;
allocate channel ch7 type disk;
allocate channel ch8 type disk;
BACKUP INCREMENTAL FROM SCN 3561046369814 database format ‘/oracle/CATY12/archive/CATY12/ForStandby3nd_%U’ tag ‘FOR STANDBY’;
}Starting backup at 2009-09-22 03:23:14
Finished backup at 2009-09-22 06:38:11
– 3 hour 15 minutes
这里没有多个备份目录,可能影响了一些性能。记录一下,以后可能有参考价值。