分类: Oracle
2014-12-03 08:49:20
实验环境:
10.2.0.2 虚拟机-linux 64位
11.1.0.6 小机-HPUNIX
11.2.0.3 小机-HPUNIX
10G 推出了bzip2算法的压缩备份。
11R1推出了zlib算法的压缩备份。
11R2推出了基本压缩备份和高级压缩备份。
备注:实验会因为坏境不同而存在多多少少的误差
1. 10G的普通备份和压缩备份
库中有数据的数据块大小一共为8865M。
1.1 10G---普通备份
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup database format '/home/oracle/dbfull_%d_%T_%t_%s';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:8196M 备份时间为:55s cpu使用率:8%
1.2 10G---bzip2压缩备份
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup as compressed backupset full database format '/home/oracle/dbfull-compreee-%U';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:5064M 备份时间:7:18分 cpu使用率:37%
2. 11R1的普通备份和压缩备份
库中有数据的数据块大小一共为9639M。
1.1 11R1---普通备份
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup database format '/pmsdb/dbfull_%d_%T_%t_%s';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:11169M 备份时间为:62s cpu使用率:14%
2.2 11R1---bzip2压缩备份
RMAN> CONFIGURE COMPRESSION ALGORITHM 'BZIP2';
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup as compressed backupset full database format '/pmsdb/dbfull-bzip2compreee-%U';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:1480M 备份时间:03:25分 cpu使用率:37%
2.3 11R1---ZLIB压缩备份
RMAN> CONFIGURE COMPRESSION ALGORITHM 'ZLIB';
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup as compressed backupset full database format '/pmsdb/dbfull-zlibcompreee-%U';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:1310M 备份时间:01:30分 cpu使用率:34%
3. 11R2的普通备份和压缩备份
库中有数据的数据块大小一共为8115M。
3.1 11R2---普通备份
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup database format '/pmsdb/oradata/dbfull_%d_%T_%t_%s';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:7517M 备份时间为:01:27分 cpu使用率:2.9%
3.2 11R2---BASIC压缩备份
RMAN> CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup as compressed backupset full database format '/pmsdb/oradata/dbfull-basiccompreee-%U';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:1148M 备份时间:04:45分 cpu使用率:14%
3.3 11R2---LOW压缩备份
RMAN> CONFIGURE COMPRESSION ALGORITHM 'LOW';
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup as compressed backupset full database format '/pmsdb/oradata/dbfull-lowcompreee-%U';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:1649M 备份时间:01:47分 cpu使用率:8%
3.4 11R2---MEDIUM压缩备份
RMAN> CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup as compressed backupset full database format '/pmsdb/oradata/dbfull-mediumcompreee-%U';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:1346M 备份时间:02:36分 cpu使用率:11%
3.5 11R2---HIGH压缩备份
RMAN> CONFIGURE COMPRESSION ALGORITHM 'HIGH';
RMAN> run
{
allocate channel ch01 type disk;
allocate channel ch02 type disk;
allocate channel ch03 type disk;
backup as compressed backupset full database format '/pmsdb/oradata/dbfull-highcompreee-%U';
release channel ch01;
release channel ch02;
release channel ch03;
}
备份文件大小:910M 备份时间:21:52分 cpu使用率:20%
遇到的问题
RMAN> CONFIGURE COMPRESSION ALGORITHM 'LOW';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 12/19/2013 09:29:18
RMAN-06806: compression algorithm 'LOW' of release DEFAULT not found
错误产生原因:
由于我的库是11.1升级到11.2的,而且我并没有修改 compatible='11.2.0.0.0',而是使用原来的 compatible为'11.1.0.0.0',可以通过查看V$RMAN_COMPRESSION_ALGORITHM来看出:
11R1的V$RMAN_COMPRESSION_ALGORITHM:
SQL> select * from V$RMAN_COMPRESSION_ALGORITHM;
ALGORITHM_ID ALGORITHM_NAME ALGORITHM_DESCRIPTION ALGORITHM_COMPATIB DATABASE_COMPATIBI IS_ IS_
------------ ------------------------------ ---------------------------------------- ------------------ ------------------ --- ---
1 ZLIB optimized for speed 11.0.0.0.0 11.1.0.0.0 YES NO
0 BZIP2 optimized for maximum compression 9.2.0.0.0 11.1.0.0.0 YES YES
这个是11R1的,这里我写出来只是为了区别升级前后这个试图的变化。
11R2的V$RMAN_COMPRESSION_ALGORITHM(compatible此时为'11.1.0.0.0'):
SQL> select ALGORITHM_NAME, INITIAL_RELEASE, TERMINAL_RELEASE, ALGORITHM_DESCRIPTION, IS_VALID, REQUIRES_ACO, IS_DEFAULT from V$RMAN_COMPRESSION_ALGORITHM;
ALGORITHM_ INITIAL_RELEASE TERMINAL_RELEASE ALGORITHM_DESCRIPTION IS_ REQ IS_
---------- ------------------ ------------------ ---------------------------------------------------------------- --- --- ---
BZIP2 10.0.0.0.0 11.2.0.0.0 good compression ratio YES NO YES
BASIC 10.0.0.0.0 good compression ratio YES NO NO
LOW 11.2.0.0.0 maximum possible compression speed NO YES NO
ZLIB 11.0.0.0.0 11.2.0.0.0 balance between speed and compression ratio YES YES NO
MEDIUM 11.2.0.0.0 balance between speed and compression ratio YES YES NO
HIGH 11.2.0.0.0 maximum possible compression ratio NO YES NO
6 rows selected.
11R2的V$RMAN_COMPRESSION_ALGORITHM(compatible此时为'11.2.0.0.0'):
SQL> col ALGORITHM_NAME for a10
SQL> col INITIAL_RELEASE for a10
SQL> col TERMINAL_RELEASE for a10
SQL> col ALGORITHM_DESCRIPTION for a50
SQL> set linesize 200
SQL> select ALGORITHM_NAME, INITIAL_RELEASE, TERMINAL_RELEASE, ALGORITHM_DESCRIPTION, IS_VALID, REQUIRES_ACO, IS_DEFAULT from V$RMAN_COMPRESSION_ALGORITHM;
ALGORITHM_ INITIAL_RE TERMINAL_R ALGORITHM_DESCRIPTION IS_ REQ IS_
---------- ---------- ---------- -------------------------------------------------- --- --- ---
BZIP2 10.0.0.0.0 11.2.0.0.0 good compression ratio YES NO NO
BASIC 10.0.0.0.0 good compression ratio YES NO YES
LOW 11.2.0.0.0 maximum possible compression speed YES YES NO
ZLIB 11.0.0.0.0 11.2.0.0.0 balance between speed and compression ratio YES YES NO
MEDIUM 11.2.0.0.0 balance between speed and compression ratio YES YES NO
HIGH 11.2.0.0.0 maximum possible compression ratio YES YES NO
6 rows selected.
然后再次执行RMAN> CONFIGURE COMPRESSION ALGORITHM 'LOW';就不会报错啦。