fishcat论 RMAN备份中加filesperset的重要性续
上篇实验留下了疑问:到底是input到备份集中的所有文件备份完成了,下次备份就不用重复备份,
还是因为DELETE INPUT把备份过的文件删除了,下次备份就不用重复备份呢?
今天为了证明,实验如下:
RMAN> run{
2> BACKUP FILESPERSET 2
3> FORMAT '/backup/arch_%T_%s_%p'
4> ARCHIVELOG ALL;
5> }
Starting backup at 07-JAN-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=45 recid=56 stamp=803342776
input archive log thread=1 sequence=46 recid=57 stamp=803425515
channel ORA_DISK_1: starting piece 1 at 07-JAN-13
channel ORA_DISK_1: finished piece 1 at 07-JAN-13
piece handle=/backup/arch_20130107_80_1 tag=TAG20130107T053134 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:09
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=50 recid=61 stamp=803968227
input archive log thread=1 sequence=51 recid=62 stamp=803969590
channel ORA_DISK_1: starting piece 1 at 07-JAN-13
c
user interrupt received
Finished backup at 07-JAN-13
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03099: job cancelled at user request
RMAN> run{
2> BACKUP FILESPERSET 2
3> FORMAT '/backup/arch_%T_%s_%p'
4> ARCHIVELOG ALL;
5> }
Starting backup at 07-JAN-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=45 recid=56 stamp=803342776
input archive log thread=1 sequence=46 recid=57 stamp=803425515
channel ORA_DISK_1: starting piece 1 at 07-JAN-13
channel ORA_DISK_1: finished piece 1 at 07-JAN-13
piece handle=/backup/arch_20130107_82_1 tag=TAG20130107T053326 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=50 recid=61 stamp=803968227
input archive log thread=1 sequence=51 recid=62 stamp=803969590
channel ORA_DISK_1: starting piece 1 at 07-JAN-13
channel ORA_DISK_1: finished piece 1 at 07-JAN-13
piece handle=/backup/arch_20130107_83_1 tag=TAG20130107T053326 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=49 recid=60 stamp=803706266
channel ORA_DISK_1: starting piece 1 at 07-JAN-13
user interrupt received
Finished backup at 07-JAN-13
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03099: job cancelled at user request
从边看到sequence45,46,50,51已经完成备份,然而中断后我们继续备份,又开始备份45,46,50,51
list看一下备份情况
RMAN> list backup of archivelog all;
.................................
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
61 28.57M DISK 00:00:05 07-JAN-13
BP Key: 57 Status: AVAILABLE Compressed: NO Tag: TAG20130107T053134
Piece Name: /backup/arch_20130107_80_1
List of Archived Logs in backup set 61
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 45 854175 26-DEC-12 874461 29-DEC-12
1 46 874461 29-DEC-12 913135 30-DEC-12
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
62 20.34M DISK 00:00:02 07-JAN-13
BP Key: 58 Status: AVAILABLE Compressed: NO Tag: TAG20130107T053134
Piece Name: /backup/arch_20130107_81_1
List of Archived Logs in backup set 62
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 50 1016793 03-JAN-13 1045991 06-JAN-13
1 51 1045991 06-JAN-13 1049414 06-JAN-13
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
63 28.57M DISK 00:00:02 07-JAN-13
BP Key: 59 Status: AVAILABLE Compressed: NO Tag: TAG20130107T053326
Piece Name: /backup/arch_20130107_82_1
List of Archived Logs in backup set 63
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 45 854175 26-DEC-12 874461 29-DEC-12
1 46 874461 29-DEC-12 913135 30-DEC-12
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
64 20.34M DISK 00:00:02 07-JAN-13
BP Key: 60 Status: AVAILABLE Compressed: NO Tag: TAG20130107T053326
Piece Name: /backup/arch_20130107_83_1
List of Archived Logs in backup set 64
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 50 1016793 03-JAN-13 1045991 06-JAN-13
1 51 1045991 06-JAN-13 1049414 06-JAN-13
可以看到RMAN备份集中有两份45,46,50,51.
综上证明:是因为DELETE INPUT把备份过的文件删除了(事实上在delete input的时候rman把备份过的文件信息在信息库中删除了,可以用crosscheck archivelog证明),下次备份就不会重复备份。