MAXSETSIZE跟MAXPIECESIZE用法
区别:maxpiecesize设置的是备份完成后的备份片大小,对备份整体的大小没有影响,比如一个G的备份完成文件,maxpiecesize设置为100M,最后就会变成10个100M的备份文件。Maxsetsize设置限定的是整体大小,个人认为这个功能比较鸡肋,一般只要没人动,就用不到的。
Maxsetsize的写法:
RMAN> configure maxsetsize to 2G;
RMAN> run{
2> allocate channel c1 device type disk;
3> backup database format="/u01/app/oracle/oradata/Backup/oradb_%d_%s.bak";
4> release channel c1;
5> }
run{
allocate channel c1 device type disk ;
backup database maxsetsize 1000M format="/u01/app/oracle/oradata/Backup/oradb_%d_%s_%p.bak";
release channel c1;
}
清除maxsetsize的语句:RMAN> CONFIGURE MAXSETSIZE clear;
Maxpiecesize的写法:
run{
allocate channel c1 device type disk MAXPIECESIZE 100M;
backup database format="/u01/app/oracle/oradata/Backup/oradb_%d_%s_%p.bak";
release channel c1;
}
然后每个文件都是100M
[oracle@orcl Backup]$ ls -lh
total 1.2G
-rw-r----- 1 oracle oinstall 100M Dec 24 03:01 oradb_ORCL_117_10.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 03:01 oradb_ORCL_117_11.bak
-rw-r----- 1 oracle oinstall 71M Dec 24 03:01 oradb_ORCL_117_12.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 02:59 oradb_ORCL_117_1.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 02:59 oradb_ORCL_117_2.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 02:59 oradb_ORCL_117_3.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 03:00 oradb_ORCL_117_4.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 03:00 oradb_ORCL_117_5.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 03:00 oradb_ORCL_117_6.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 03:00 oradb_ORCL_117_7.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 03:00 oradb_ORCL_117_8.bak
-rw-r----- 1 oracle oinstall 100M Dec 24 03:00 oradb_ORCL_117_9.bak
-rw-r----- 1 oracle oinstall 9.7M Dec 24 03:01 oradb_ORCL_118_1.bak