commvault SIMPANA 7.0
中增加了很炫的断点续传功能,这个功能神奇的地方在于对于
oracle
也是有效的。今天针对
oracle
备份的断点续传做了一些测试,初步了解一下断点续传的本质,可以说,这并非真正意义上的断点续传(当然,
Simpana 8
的表现如何,就不得而知了),请细看下面的分析过程。
在
commvault simpana
中,一个
oracle
备份的作业可以同时备份数据文件,控制文件,归档日志。其中,数据文件和控制文件是一起备份的,通过加上
include current controlfile
命令。归档日志的备份是一个新的命令
run
块。
其备份的命令脚本如下:
//
第一次发起备份操作,备份内容包括数据文件,控制文件,归档日志,程序分步对其进行备份;
//
先备份数据文件和控制文件
Rman Script.:
[run {
allocate channel ch1 type 'sbt_tape'
PARMS="BLKSIZE=262144,ENV=(CV_mmsApiVsn=2,CV_channelPar=ch1,ThreadCommandLine=BACKUP -jm 45 -a 2:13 -cl 2 -ins 6 -at
22 -j 6 -jt 6:3:1 -bal 1 -bap 0 -rap 0 -rcp 0 -mav 0 -ms 1 -data -cn oracle9i -vm Instance001 -vm oracle9i)"
TRACE 0;
setlimit channel ch1 maxopenfiles 8;
backup
incremental level = 0
filesperset = 32
database
include current controlfile ;
}
exit;
]
//
备份数据文件和控制文件的过程信息。
Rman Log:[
Recovery Manager: Release 9.2.0 .1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN>
RMAN>
connected to target database: EISOO (DBID=3525345166)
using target database controlfile instead of recovery catalog
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11>
allocated channel: ch1
channel ch1: sid=12 devtype=SBT_TAPE
channel ch1: CommVault Systems for Oracle: Version 7.0.0 (BUILD76)
Starting backup at 25-DEC-08
channel ch1: starting incremental level 0 datafile backupset
channel ch1: specifying datafile(s) in backupset
including current SPFILE in backupset
including current controlfile in backupset
input datafile fno=00001 name=F:\ORACLE\ORADATA\EISOO\SYSTEM01.DBF
input datafile fno=00002 name=F:\ORACLE\ORADATA\EISOO\UNDOTBS01.DBF
input datafile fno=00005 name=F:\ORACLE\ORADATA\EISOO\EXAMPLE01.DBF
input datafile fno=00010 name=F:\ORACLE\ORADATA\EISOO\XDB01.DBF
input datafile fno=00006 name=F:\ORACLE\ORADATA\EISOO\INDX01.DBF
input datafile fno=00009 name=F:\ORACLE\ORADATA\EISOO\USERS01.DBF
input datafile fno=00003 name=F:\ORACLE\ORADATA\EISOO\CWMLITE01.DBF
input datafile fno=00004 name=F:\ORACLE\ORADATA\EISOO\DRSYS01.DBF
input datafile fno=00007 name=F:\ORACLE\ORADATA\EISOO\ODM01.DBF
input datafile fno=00008 name=F:\ORACLE\ORADATA\EISOO\TOOLS01.DBF
channel ch1: starting piece 1 at 25-DEC-08
//
在此断开网络连接,拔掉网线,程序由于网络连接断开异常退出。此时数据文件的备份还未完成。完成的备份数据是 116M
,在介质下CHUNK_13
目录中。
//
插上网线,网络正常后,进入commvault
管理控制台,发现此作业处于pending
状态,选择此作业,点击重新开始,程序脚本如下
//
数据文件和控制文件重新开始备份。
Rman Script.:
[run {
allocate channel ch1 type 'sbt_tape'
PARMS="BLKSIZE=262144,ENV=(CV_mmsApiVsn=2,CV_channelPar=ch1,ThreadCommandLine=BACKUP -jm 45 -a 2:13 -cl 2 -ins 6 -at
22 -j 6 -jt 6:3:3 -bal 1 -bap 0 -rap 0 -rcp 0 -mav 0 -ms 1 -data -cn oracle9i -vm Instance001 -vm oracle9i)"
TRACE 0;
setlimit channel ch1 maxopenfiles 8;
backup
incremental level = 0
filesperset = 32
database
include current controlfile ;
}
exit;
]
//
备份数据文件和控制文件的过程信息。
Rman Log:[
Recovery Manager: Release 9.2.0 .1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN>
RMAN>
connected to target database: EISOO (DBID=3525345166)
using target database controlfile instead of recovery catalog
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11>
allocated channel: ch1
channel ch1: sid=16 devtype=SBT_TAPE
channel ch1: CommVault Systems for Oracle: Version 7.0.0 (BUILD76)
Starting backup at 25-DEC-08
channel ch1: starting incremental level 0 datafile backupset
channel ch1: specifying datafile(s) in backupset
including current SPFILE in backupset
including current controlfile in backupset
input datafile fno=00001 name=F:\ORACLE\ORADATA\EISOO\SYSTEM01.DBF
input datafile fno=00002 name=F:\ORACLE\ORADATA\EISOO\UNDOTBS01.DBF
input datafile fno=00005 name=F:\ORACLE\ORADATA\EISOO\EXAMPLE01.DBF
input datafile fno=00010 name=F:\ORACLE\ORADATA\EISOO\XDB01.DBF
input datafile fno=00006 name=F:\ORACLE\ORADATA\EISOO\INDX01.DBF
input datafile fno=00009 name=F:\ORACLE\ORADATA\EISOO\USERS01.DBF
input datafile fno=00003 name=F:\ORACLE\ORADATA\EISOO\CWMLITE01.DBF
input datafile fno=00004 name=F:\ORACLE\ORADATA\EISOO\DRSYS01.DBF
input datafile fno=00007 name=F:\ORACLE\ORADATA\EISOO\ODM01.DBF
input datafile fno=00008 name=F:\ORACLE\ORADATA\EISOO\TOOLS01.DBF
channel ch1: starting piece 1 at 25-DEC-08
channel ch1: finished piece 1 at 25-DEC-08
piece handle=08k358v4_1_1 comment=API Version 2.0,MMS Version 7.0.0 .76
channel ch1: backup set complete, elapsed time: 00:01:36
Finished backup at 25-DEC-08
released channel: ch1
RMAN>
// rman
提示数据文件和控制文件正常完成,备份数据存放在介质下CHUNK_15
目录中,大小为 178M
。
Recovery Manager complete.
//
接下来程序接着备份归档日志。
]Rman Script.:
[run {
allocate channel ch1 type 'sbt_tape'
PARMS="BLKSIZE=262144,ENV=(CV_mmsApiVsn=2,CV_channelPar=ch1,ThreadCommandLine=BACKUP -jm 45 -a 2:13 -cl 2 -ins 6 -at
22 -j 6 -jt 6:4:1 -bal 1 -bap 0 -rap 0 -rcp 0 -mav 0 -ms 1 -logs -cn oracle9i -vm Instance001 -vm oracle9i)"
TRACE 0;
setlimit channel ch1 maxopenfiles 8;
sql "alter system archive log current";
backup
filesperset = 32
(archivelog all delete input );
}
exit;
]
Rman Log:[
//
在此处,归档日志还没有备份完成,再次断开网络,程序异常退出。
//
接下来,正常连接网络,进入commvault
管理控制台,发现此作业处于pending
状态,选择此作业,点击重新开始。
//
程序不再备份数据文件和控制文件,而是重新备份归档日志文件。
Rman Script.:
[run {
allocate channel ch1 type 'sbt_tape'
PARMS="BLKSIZE=262144,ENV=(CV_mmsApiVsn=2,CV_channelPar=ch1,ThreadCommandLine=BACKUP -jm 45 -a 2:13 -cl 2 -ins 6 -at
22 -j 6 -jt 6:4:2 -bal 1 -bap 0 -rap 0 -rcp 0 -mav 0 -ms 1 -logs -cn oracle9i -vm Instance001 -vm oracle9i)"
TRACE 0;
setlimit channel ch1 maxopenfiles 8;
sql "alter system archive log current";
backup
filesperset = 32
(archivelog all delete input );
}
exit;
]
Rman Log:[
Recovery Manager: Release 9.2.0 .1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN>
RMAN>
connected to target database: EISOO (DBID=3525345166)
using target database controlfile instead of recovery catalog
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10>
allocated channel: ch1
channel ch1: sid=12 devtype=SBT_TAPE
channel ch1: CommVault Systems for Oracle: Version 7.0.0 (BUILD76)
sql statement: alter system archive log current
Starting backup at 25-DEC-08
current log archived
channel ch1: starting archive log backupset
channel ch1: specifying archive log(s) in backup set
input archive log thread=1 sequence=5 recid=5 stamp=674407663
input archive log thread=1 sequence=6 recid=6 stamp=674407664
input archive log thread=1 sequence=7 recid=7 stamp=674407805
input archive log thread=1 sequence=8 recid=8 stamp=674407805
channel ch1: starting piece 1 at 25-DEC-08
channel ch1: finished piece 1 at 25-DEC-08
piece handle=0ak359bt_1_1 comment=API Version 2.0,MMS Version 7.0.0 .76
channel ch1: backup set complete, elapsed time: 00:00:16
channel ch1: deleting archive log(s)
archive log filename=F:\ORACLE\ORADATA\EISOO\ARCHIVE\1_5.ARC recid=5 stamp=674407663
archive log filename=F:\ORACLE\ORADATA\EISOO\ARCHIVE\1_6.ARC recid=6 stamp=674407664
archive log filename=F:\ORACLE\ORADATA\EISOO\ARCHIVE\1_7.ARC recid=7 stamp=674407805
archive log filename=F:\ORACLE\ORADATA\EISOO\ARCHIVE\1_8.ARC recid=8 stamp=674407805
Finished backup at 25-DEC-08
released channel: ch1
RMAN>
Recovery Manager complete.
]
结论:
从这个测试过程可以看出,commvault
针对oracle
的断点续传功能的策略是:以保证数据的完整性为前提,将作业中的数据对象的备份分为几个过程,当某一个过程的备份失败后,下次重新开始时,则是从这个失败的过程重新开始,而不是将所有的数据都重新备份。
例 如,从这个测试中,数据文件和控制文件是一个备份过程,归档日志是一个备份过程。当数据文件和控制文件的备份过程中失败后,下次重新开始时则要重新备份数 据文件和控制文件,而不是从失败的那个时间点开始。以此类推,当数据文件和控制文件备份成功完成后,在备份归档日志的时候失败了,那么下次重新开始时程序 只会重新备份归档日志。
可以说,这并不是真正意义上的断点续传,真正意义上的断点续传应该是从中断的那个即时点开始,而不是以数据文件、日志文件为单位。
另外,个人认为,在同一时间点同时备份数据文件、日志文件的这种方式是不可取的,数据文件和日志文件在某种意义上说,是冗余的关系,如果我们每次都要备份这些数据,即便是增量备份,也会有重复备份的嫌疑。
所以,最合适的备份方式是采用完全备份+
增量备份+
归档日志备份的这种组合方式,例如:每周末对数据库做个完全备份,每天对数据库进行一次增量备份,每天
每隔2
个小时对归档日志做一次备份,也即这三种备份不是在同一个时间进行,所以无论是从每一次备份的效率、还是从整体备份所需要的存储空间,还是数据的保
护力度上,采用三种备份方式相结合的方式都要优于前者
Leo Guan
撰写于2009年5月