【RMAN】使用RMAN的 Compressed Backupsets备份压缩技术 (转载)
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 / <<EOF
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 / <<EOF
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 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00009 name=/u01/app/oracle/oradata/secooler/DATA01_02.dbf
input datafile fno=00010 name=/u01/app/oracle/oradata/secooler/DATA01_03.dbf
input datafile fno=00011 name=/u01/app/oracle/oradata/secooler/DATA01_04.dbf
input datafile fno=00012 name=/u01/app/oracle/oradata/secooler/DATA01_05.dbf
input datafile fno=00013 name=/u01/app/oracle/oradata/secooler/DATA01_01.dbf
input datafile fno=00015 name=/u01/app/oracle/oradata/secooler/lob_data01.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_2olje653188.rmn tag=TAG20100721T222949 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 21-JUL-10
Starting Control File and SPFILE Autobackup at 21-JUL-10
piece handle=/u01/app/oracle/rmanbak/cf_c-4067316777-20100721-0e comment=NONE
Finished Control File and SPFILE Autobackup at 21-JUL-10
RMAN>
Recovery Manager complete.
Thu Jul 21 22:31:30 CST 2010
2)不含压缩功能的测试脚本执行输出结果
[oracle@secdb rmanbak]$ sh test_rman_nocompress.sh
Thu Jul 21 22:39:29 CST 2010
Recovery Manager: Release 10.2.0.1.0 - Production on Thu Jul 21 22:39:29 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: SECOOLER (DBID=4067316777)
RMAN>
using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET PARALLELISM 1;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET PARALLELISM 1;
new RMAN configuration parameters are successfully stored
RMAN>
Starting backup at 21-JUL-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=152 devtype=DISK
channel ORA_DISK_1: starting 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_2tlje6kl193.rmn tag=TAG20100721T223932 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00009 name=/u01/app/oracle/oradata/secooler/DATA01_02.dbf
input datafile fno=00010 name=/u01/app/oracle/oradata/secooler/DATA01_03.dbf
input datafile fno=00011 name=/u01/app/oracle/oradata/secooler/DATA01_04.dbf
input datafile fno=00012 name=/u01/app/oracle/oradata/secooler/DATA01_05.dbf
input datafile fno=00013 name=/u01/app/oracle/oradata/secooler/DATA01_01.dbf
input datafile fno=00015 name=/u01/app/oracle/oradata/secooler/lob_data01.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_2ulje6mn194.rmn tag=TAG20100721T223932 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 21-JUL-10
Starting Control File and SPFILE Autobackup at 21-JUL-10
piece handle=/u01/app/oracle/rmanbak/cf_c-4067316777-20100721-10 comment=NONE
Finished Control File and SPFILE Autobackup at 21-JUL-10
RMAN>
Recovery Manager complete.
Thu Jul 21 22:41:06 CST 2010
3)比较时间消耗
从elapsed time可以得出以下信息:
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
启用压缩耗时: 00:01:25 + 00:00:07 = 00:01:32
未启用压缩耗时:00:01:05 + 00:00:15 = 00:01:20
结论:启用压缩备份耗时略有增加(在数据量较大的环境下这个时间差会比较大)。
4)从top监控CPU使用率上进行比较
启用压缩备份期间CPU使用率监控结果
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4972 oracle 25 0 424m 52m 23m R 65.4 0.6 0:32.62 oracle
未启用压缩备份期间CPU使用率监控结果
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5902 oracle 25 0 423m 47m 25m R 33.1 0.6 0:09.17 oracle
结论:启用压缩CPU使用率在65.4%左右,未启用时的CPU使用率在33.1%左右。差别很明显,启用压缩将消耗更多的CPU资源。
5)比较生成的备份集大小
压缩备份集大小
[oracle@secdb rmanbak]$ du -sm /u01/app/oracle/rmanbak/full_bk1_2nlje62e187.rmn
168 /u01/app/oracle/rmanbak/full_bk1_2nlje62e187.rmn
未压缩备份集大小
[oracle@secdb rmanbak]$ du -sm /u01/app/oracle/rmanbak/full_bk1_2tlje6kl193.rmn
951 /u01/app/oracle/rmanbak/full_bk1_2tlje6kl193.rmn
结论:启用压缩功能,备份集大小是168M,而未启用压缩功能的备份集大小有951M大,是压缩备份集的5.7倍。这就是压缩备份带来的最大好处。
4.小结
使用RMAN备份压缩技术可以在很大程度上节省存储备份的空间,是典型的以时间和CPU换取空间的做法。如果系统有合理的备份窗口,不妨将这项技术引入到日常备份中去。
Good luck.
secooler
10.07.21
-- The End --
【RMAN】使用RMAN的 Compressed Backupsets备份压缩技术 (转载)的更多相关文章
- rman实验——测试备份压缩
oracle rman自带的备份压缩机制,可以有效的压缩备份的大小,降低磁盘的占用率.但是也会因为压缩而消耗更多的系统性能,和增加备份时间.现在就通过实验来看压缩和不压缩的区别. 进行不压缩全备 RM ...
- 【RMAN】RMAN脚本中使用替换变量
[RMAN]RMAN脚本中使用替换变量--windows 下rman全备脚本 一.1 BLOG文档结构图 一.2 前言部分 一.2.1 导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也 ...
- 【RMAN】RMAN跨版本恢复(下)--大版本异机恢复
[RMAN]RMAN跨版本恢复(下)--大版本异机恢复 BLOG文档结构图 ORACLE_SID=ORA1024G 关于10g的跨小版本恢复参考:http://blog.chinaunix.net/u ...
- rman catalog (rman 恢复目录)
受控制文件大小的限制,一般rman需要用rman catalog来管理及存放备份信息: 这里介绍一下创建rman catalog的步骤: C:\Documents andSettings\Admini ...
- [Oracle][RMAN] Use RMAN to Migrate database from CentOS_5-11201-SingleDB to OracleLinux_5-11204-SingleDB
リンク:How to Move/Restore DB to New Host and File System using RMAN (Doc ID 1338193.1)https://docs.ora ...
- sql server数据库备份压缩拷贝实例
--数据库备份压缩拷贝实例:前提要安装RAR压缩软件--声明变量declare @day varchar(10),@dbname varchar(20),@filename varchar(100), ...
- MongoDB 如何实现备份压缩
背景及原理 数据库的备份是灾难恢复的最后一道屏障,不管什么类型的数据库都需要设置数据库备份,MongoDB也不例外.MongoDB 3.0 后 ,数据库可以采用Wiredtiger存储引擎后(3.2 ...
- 云计算之路-试用Azure:数据库备份压缩文件在虚拟机上的恢复速度测试
测试环境:Windows Azure上海机房,虚拟机配置为大型(四核,7 GB 内存),磁盘情况见下图. 数据库备份压缩文件大于为12.0 GB (12,914,327,552 bytes),放置于T ...
- linux下的nginx日志自动备份压缩--日志切割机
部署完毕nginx之后,发现自己的/var/log/nginx/*log的日志不会压缩,一直都是一个文本写日志, 时间久了,日志文件内存过于增加,将会导致在日志添加过程效率降低,延长时间. 默认安装的 ...
随机推荐
- SVM、LR、决策树的对比
一.LR LR,DT,SVM都有自身的特性,首先来看一下LR,工业界最受青睐的机器学习算法,训练.预测的高效性能以及算法容易实现使其能轻松适应工业界的需求.LR还有个非常方便实用的额外功能就是它并不会 ...
- CMake使用总结(转的)+自己的实践心得
来自https://www.mawenbao.com/note/cmake.html 总结CMake的常用命令,并介绍有用的CMake资源. CMake意为cross-platform make,可用 ...
- Golang package
今天,灵感一现:不能一个文件干到底吧,那要是工程大了怎么办? 答案很简单,“包”啊 GO里的包,看起来很简单,但又不简单 一开始,我想当然的以为就是include 路径一样的问题 事实是,GO以GOP ...
- ubuntu下ldd,查看程序动态库信息
ldd list, dynamic, dependencies linux-vdso.so. => (0x00007ffe9d9b6000) libstdc++.so. => /usr/ ...
- MyBatis基础入门《五》核心配置文件
MyBatis基础入门<五>核心配置文件 描述: 在前面的章节中,简单的学习使用了一下mybatis,对于配置文件没有过多详细说明. 这里先描述项目中的一个核心配置文件:mybatis-c ...
- MYSQLi数据访问批量删除
<link href="../bootstrap.min.css" rel="stylesheet" type="text/css" ...
- Unity shader学习之标准的Unity shader
包含光照,可处理多个光源,有光照衰减和阴影的shader,代码如下: 转载请注明出处:http://www.cnblogs.com/jietian331/p/7199311.html Shader & ...
- OpenGL and Vulkan resources
OpenGL https://www.zhihu.com/question/22005157https://open.gl/https://github.com/cybercser/OpenGL_3_ ...
- qt5.5.1 移植4412的问题过程
1.编译错误: ../WTF/wtf/unicode/wchar/UnicodeWchar.h: In function 'bool WTF::Unicode::isAlphanumeric(UCha ...
- java 泛型E T ?的区别
Java泛型中的标记符含义: E - Element (在集合中使用,因为集合中存放的是元素) T - Type(Java 类) K - Key(键) V - Value(值) N - Number ...