Linux下RMAN备份脚本

2014-11-24 18:35:18 · 作者: · 浏览: 0

OFFLINE
Specifies that offline datafiles should be excluded from the backup set.


READONLY
Specifies that read-only datafiles should be excluded from the backup set.


INACCESSIBLE
Specifies that datafiles or archived redo logs that cannot be read due to I/O errors should be excluded from the backup set.


A datafile is only considered inaccessible if it cannot be read. Some offline datafiles can still be read because they still exist on disk. Others have been deleted or moved and


so cannot be read, making them inaccessible.



FILESPERSET = integer
Specifies the maximum number of input files in each backup set. If you set FILESPERSET = n, then RMAN never includes more than n files in a backup set. The default for


FILESPERSET is the lesser of these two values: 64, number of input files divided by the number of channels. For example, if you back up 100 datafiles by using two channels, RMAN


sets FILESPERSET to 50.


RMAN always attempts to create enough backup sets so that all allocated channels have work to do. An exception to the rule occurs when there are more channels than files to back up. For example, if RMAN backs up two datafiles when three channels are allocated and FILESPERSET = 1, then one channel is necessarily idle.


示例:
平均文件数指:文件数/通道数。
allocate channel 提供备份并发度,若平均文件数1、run {
allocate channel ch1 type disk;
allocate channel ch2 type disk;
backup datafile 3,4,5,6 filesperset 3;
release channel ch1;
release channel ch2;
}
平均数是 4(文件数)/2(channel数) = 2 ,小于filesperset 3,则生成2个备份集,每个备份集包含2个数据文件


2、run {
allocate channel ch1 type disk;
allocate channel ch2 type disk;
backup datafile 3,4,5,6 filesperset 1;
release channel ch1;
release channel ch2;
}
则生成4个备份集,每个包含一个数据文件


备份脚本:


邮件配置...