eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 小技巧-如何让页面上所有的链接都在新窗口打开 | Blog首页 | 启用Block Change Tracking-10g新特性 »

Oracle10g备份集压缩新特性(Backupset Compression)

Oracle10g允许你和BACKUP命令伴随使用AS COMPRESSED BACKUPSET字句,对备份集进行压缩。
这个压缩备份在恢复时无需解压缩,这一特性在以下条件下可能大为有益:
1.你的备份存储空间有限
2.通过网络备份而带宽有限
3.直接备份至磁带、CD,DVD介质而压缩不可用

你可以选择在备份命令里显示指定压缩选项:
BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;
--仅对1,5文件压缩备份
BACKUP AS COMPRESSED BACKUPSET DATAFILE 1,5;

也可以配置RMAN指定压缩选项:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;

但是压缩备份会消耗更多的资源以及时间。
我们看一下以下测试:
1.压缩备份

RMAN> backup full filesperset 11 database ; Starting backup at 29-MAR-05 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=161 devtype=DISK channel ORA_DISK_1: starting compressed full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00009 name=/data1/oradata/systemfile/bigtbs.dbf input datafile fno=00001 name=/opt/oracle/oradata/eygle/system01.dbf input datafile fno=00006 name=/opt/oracle/oradata/eygle/EYGLE/datafile/o1_mf_test_03xv34ny_.dbf input datafile fno=00002 name=/opt/oracle/oradata/eygle/undotbs01.dbf input datafile fno=00003 name=/opt/oracle/oradata/eygle/sysaux01.dbf input datafile fno=00004 name=/opt/oracle/oradata/eygle/users01.dbf input datafile fno=00007 name=/opt/oracle/oradata/eygle/EYGLE/datafile/o1_mf_itpub_03xv5g66_.dbf input datafile fno=00010 name=/opt/oracle/oradata/eygle/dfmbrc.dbf input datafile fno=00008 name=/opt/oracle/oradata/eygle/trans01.dbf input datafile fno=00005 name=/data1/oradata/systemfile/eygle01.dbf channel ORA_DISK_1: starting piece 1 at 29-MAR-05 channel ORA_DISK_1: finished piece 1 at 29-MAR-05 piece handle=/data5/flash_recovery_area/EYGLE/backupset/ 2005_03_29/o1_mf_nnndf_TAG20050329T062814_14k1813y_.bkp comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:08:35 channel ORA_DISK_1: starting compressed full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00011 name=/opt/oracle/oradata/eygle/t2k01.dbf channel ORA_DISK_1: starting piece 1 at 29-MAR-05 channel ORA_DISK_1: finished piece 1 at 29-MAR-05 piece handle=/data5/flash_recovery_area/EYGLE/backupset/2005_03_29/ o1_mf_nnndf_TAG20050329T062814_14k1r4fh_.bkp comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 Finished backup at 29-MAR-05 Starting Control File and SPFILE Autobackup at 29-MAR-05 piece handle=/data5/flash_recovery_area/EYGLE/autobackup/ 2005_03_29/o1_mf_s_554193419_14k1rdyr_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 29-MAR-05

注意压缩备耗时:00:08:35 + 00:00:07 = 8:42 = 522s

2.非压缩备份

RMAN> configure device type disk backup type to compressed backupset; old RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1; new RMAN configuration parameters are successfully stored released channel: ORA_DISK_1 RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO backupset; old RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED 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> backup full filesperset 11 database ; Starting backup at 29-MAR-05 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=161 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00009 name=/data1/oradata/systemfile/bigtbs.dbf input datafile fno=00001 name=/opt/oracle/oradata/eygle/system01.dbf input datafile fno=00006 name=/opt/oracle/oradata/eygle/EYGLE/datafile/o1_mf_test_03xv34ny_.dbf input datafile fno=00002 name=/opt/oracle/oradata/eygle/undotbs01.dbf input datafile fno=00003 name=/opt/oracle/oradata/eygle/sysaux01.dbf input datafile fno=00004 name=/opt/oracle/oradata/eygle/users01.dbf input datafile fno=00007 name=/opt/oracle/oradata/eygle/EYGLE/datafile/o1_mf_itpub_03xv5g66_.dbf input datafile fno=00010 name=/opt/oracle/oradata/eygle/dfmbrc.dbf input datafile fno=00008 name=/opt/oracle/oradata/eygle/trans01.dbf input datafile fno=00005 name=/data1/oradata/systemfile/eygle01.dbf channel ORA_DISK_1: starting piece 1 at 29-MAR-05 channel ORA_DISK_1: finished piece 1 at 29-MAR-05 piece handle=/data5/flash_recovery_area/EYGLE/backupset/2005_03_29/ o1_mf_nnndf_TAG20050329T065513_14k2tmx7_.bkp comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00011 name=/opt/oracle/oradata/eygle/t2k01.dbf channel ORA_DISK_1: starting piece 1 at 29-MAR-05 channel ORA_DISK_1: finished piece 1 at 29-MAR-05 piece handle=/data5/flash_recovery_area/EYGLE/backupset/2005_03_29/ o1_mf_nnndf_TAG20050329T065513_14k2y7go_.bkp comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 Finished backup at 29-MAR-05 Starting Control File and SPFILE Autobackup at 29-MAR-05 piece handle=/data5/flash_recovery_area/EYGLE/autobackup/2005_03_29/ o1_mf_s_554194638_14k2yhwz_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 29-MAR-05 RMAN>

非压缩备份耗时: 00:01:55 + 00:00:07 = 2:02 = 122s
压缩备份使用的时间是非压缩方式的: 522 / 122 = 4.28 倍.

3.压缩比率

$ ls -l total 2585568 -rw-r----- 1 oracle dba 190103552 Mar 29 06:36 o1_mf_nnndf_TAG20050329T062814_14k1813y_.bkp -rw-r----- 1 oracle dba 1093632 Mar 29 06:36 o1_mf_nnndf_TAG20050329T062814_14k1r4fh_.bkp -rw-r----- 1 oracle dba 1130618880 Mar 29 06:57 o1_mf_nnndf_TAG20050329T065513_14k2tmx7_.bkp -rw-r----- 1 oracle dba 1302528 Mar 29 06:57 o1_mf_nnndf_TAG20050329T065513_14k2y7go_.bkp

压缩备份大小: 190103552 + 1093632 = 182.33984375 M
非压缩备份集: 1130618880 + 1302528 = 1079.484375 M

非压缩较压缩大小: 1079.484375/182.33984375 = 5.9 倍
压缩方式大大节省了空间。

4.CPU消耗
压缩备份时CPU消耗:

PID USERNAME THR PR NCE SIZE RES STATE TIME FLTS CPU COMMAND 15252 oracle 11 10 0 430M 353M cpu01 1:38 0 26.35% oracle

大约在26%左右。
而非压缩模式下CPU消耗:

PID USERNAME THR PR NCE SIZE RES STATE TIME FLTS CPU COMMAND 15252 oracle 11 52 0 445M 364M sleep 9:07 57 16.43% oracle

大约为16%
压缩模式较非压缩模式多消耗10%左右的CPU
看来选择那种模式要依赖你的环境及需要,但是毕竟Oracle提供了更多的可选项给我们。

历史上的今天...
    >> 2013-03-29文章:
    >> 2011-03-29文章:
    >> 2007-03-29文章:

无觅

By eygle on 2005-03-29 09:02 | Comments (1) | Backup&Recovery | 224 |

1 Comment

我的在xp环境下的实验怎么得出的结论跟你的相反?


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com