RMAN冗余备份和并发备份
RMAN冗余备份(duplex backup)
冗余备份不能放置在闪回区,需要自己定义其他的存放目录;
RMAN> backup copies 2 tablespace users; ##默认使用闪回区
Starting backup at 15-MAY-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/oracle/11g/oradata/mysql_master_1003306/users01.dbf
channel ORA_DISK_1: starting piece 1 at 15-MAY-18
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/15/2018 21:09:51
ORA-19806: cannot make duplex backups in recovery area
方法1:
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; ##1改为2将会备两份CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
方法2:
backup copies 2 tablespace users format '/oracle/11g/backup/orcl/backup01/%U','/oracle/11g/backup/orcl/backup02/%U';
##如果只写一个format,那么两个文件都将放在那个路径下
方法3:
run {
set backup copies 2;
backup device type disk format '/oracle/11g/backup/orcl/backup01/%U','/oracle/11g/backup/orcl/backup02/%U' tablespace users,tbs01;
}
RMAN并发备份
如果一个文件跟大,将需要并行化这一文件的备份,通常,一个通道只能读一个文件,但是用多段关键字可以改变这一行为:
run {
allocate channel c1 device type disk format '/oracle/11g/backup/orcl/backup01/%U';
allocate channel c2 device type disk format '/oracle/11g/backup/orcl/backup01/%U';
allocate channel c3 device type disk format '/oracle/11g/backup/orcl/backup01/%U';
allocate channel c4 device type disk format '/oracle/11g/backup/orcl/backup01/%U';
backup datafile 1 section size 1m;
}
##如果format指向不同的路径,那么文件将分布在其路径下,指向同一个路径,则都放在同一个路径下
这一脚本将启动4个通道,每个通道读取数据文件16的一段10GB的段。每个通道将生成包含段的备份的片(单独的物理文件)。
如果文件为200GB, 将有20个这样的片,一次生成4个。没有section size 关键字,并行读将为1(也就是序列化),用一个通道执行整个操作。
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 289211569@qq.com