RMAN的压缩备份

本文详细介绍了如何通过RMAN启用和取消数据库备份压缩,包括调整RMAN参数和直接使用RMAN命令的方法。通过两个测试脚本,对比了启用压缩备份与未启用时的时间消耗、CPU使用率和备份文件大小,结果显示启用压缩备份能显著减少存储需求,但会增加CPU使用率。在考虑备份策略时,可以根据系统资源和存储空间来权衡是否使用RMAN的压缩功能。
摘要由CSDN通过智能技术生成


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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值