RMAN的压缩备份
1.Oracle参考文档中关于RMAN备份压缩的描述
1)关于如何通过调整RMAN参数启用取消备份压缩功能
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/setup004.htm#sthref229
使用关键字COMPRESSED启用RMAN压缩备份方法
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
去掉COMPRESSED关键字取消RMAN压缩备份方法
RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET;
2)关于如何直接使用RMAN命令启用备份压缩功能
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/bkup002.htm#BRBSC138
两条压缩备份的RMAN语句,第一条语句实现对整个数据库及归档日志进行压缩备份,第二条命令实现对1、2和4号数据文件进行压缩备份。
BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;
BACKUP AS COMPRESSED BACKUPSET DATAFILE 1,2,4;
2.测试压缩备份
1)测试脚本
(1)具有压缩功能的测试脚本
[oracle@secdb rmanbak]$ cat test_rman_compress.sh
date
rman target / <<1eof<1 span="">
backup as compressed backupset full database format '/u01/app/oracle/rmanbak/full_bk1_%u%p%s.rmn';
exit;
EOF
date
(2)不含压缩功能的测试脚本
[oracle@secdb rmanbak]$ cat test_rman_nocompress.sh
date
rman target / <<1eof<1 span="">
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET;
backup full database format '/u01/app/oracle/rmanbak/full_bk1_%u%p%s.rmn';
exit;
EOF
date
3.执行RMAN测试脚本及结论分析
1)具有压缩功能的测试脚本执行输出结果
[oracle@secdb rmanbak]$ sh test_rman_compress.sh
Thu Jul 21 22:29:46 CST 2010
Recovery Manager: Release 10.2.0.1.0 - Production on Thu Jul 21 22:29:46 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: SECOOLER (DBID=4067316777)
RMAN>
Starting backup at 21-JUL-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=152 devtype=DISK
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/secooler/system01.dbf
input datafile fno=00017 name=/u01/app/oracle/oradata/secooler/tbs_perf_01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/secooler/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/secooler/example01.dbf
input datafile fno=00007 name=/u01/app/oracle/oradata/secooler/tbs_rman_catalog01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/secooler/undotbs01.dbf
input datafile fno=00006 name=/u01/app/oracle/oradata/secooler/user_08.dbf
input datafile fno=00018 name=/u01/app/oracle/oradata/secooler/EXAMPLE1_01.dbf
input datafile fno=00019 name=/u01/app/oracle/oradata/secooler/OLTP_01.dbf
input datafile fno=00020 name=/u01/app/oracle/oradata/secooler/OLTP_02.dbf
input datafile fno=00008 name=/u01/app/oracle/oradata/secooler/tbs1.dbf
input datafile fno=00014 name=/u01/app/oracle/oradata/secooler/indx_01.dbf
input datafile fno=00016 name=/u01/app/oracle/oradata/secooler/tbs_assm_01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/secooler/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-JUL-10
channel ORA_DISK_1: finished piece 1 at 21-JUL-10
piece handle=/u01/app/oracle/rmanbak/full_bk1_2nlje62e187.rmn tag=TAG20100721T222949 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting compressed full