rman压缩比测试

来源:互联网 发布:膝盖伸直有响声 知乎 编辑:程序博客网 时间:2024/05/17 22:49
==>实验环境
10g R2
操作系统是redhat 5.5
数据文件全部存放在ASM下
==>查看数据数据占用的磁盘空间
SQL> select sum(bytes)/1024/1024/1024  "DATA_BYTES(GB)" from dba_segments;
DATA_BYTES(GB)
--------------
1.17108154

不做压缩的全库备份,不备归档
#!/bin/bash
. /etc/profile
. ~/.bash_profile
date
rman target / <<EOF
run
{
ALLOCATE CHANNEL 'ch00' TYPE DISK;
backup database format='/tmp/rman_backup/rman_backup_%s_%t.data';
RELEASE CHANNEL ch00;
}
EOF
date
==>备份后的备份集信息
RMAN> list backup;
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
16      Full    1.55G      DISK        00:01:15     29-APR-14 ==>非压缩备份数据文件大小
        BP Key: 16   Status: AVAILABLE  Compressed: NO  Tag: TAG20140429T103227==>Compressed: NO 说明是非压缩备份
        Piece Name: /tmp/rman_backup/rman_backup_18_846153147.data
  List of Datafiles in backup set 16
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 2632311    29-APR-14 +DATA_DG/orcl/datafile/system.256.835611829
  2       Full 2632311    29-APR-14 +DATA_DG/orcl/datafile/undotbs1.258.835611831
  3       Full 2632311    29-APR-14 +DATA_DG/orcl/datafile/sysaux.257.835611829
  4       Full 2632311    29-APR-14 +DATA_DG/orcl/datafile/users.259.835611833
  5       Full 2632311    29-APR-14 +DATA_DG/orcl/datafile/example.269.835611969
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
17      Full    7.11M      DISK        00:00:01     29-APR-14      
        BP Key: 17   Status: AVAILABLE  Compressed: NO  Tag: TAG20140429T103227
        Piece Name: /tmp/rman_backup/rman_backup_19_846153223.data
  Control File Included: Ckp SCN: 2632341      Ckp time: 29-APR-14
  SPFILE Included: Modification time: 29-APR-14

做压缩的全库备份,不备归档
#!/bin/bash
. /etc/profile
. ~/.bash_profile
date
rman target / <<EOF
run
{
ALLOCATE CHANNEL 'ch00' TYPE DISK;
backup as compressed backupset database format='/tmp/rman_backup/rman_backup_compressed_%s_%t.data';
RELEASE CHANNEL ch00;
}
EOF
date

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
18      Full    328.38M    DISK        00:00:53     29-APR-14 ==>压缩后的备份集大小
        BP Key: 18   Status: AVAILABLE  Compressed: YES  Tag: TAG20140429T103607==>Compressed: YES说明是压缩备份
        Piece Name: /tmp/rman_backup/rman_backup_compressed_20_846153367.data
  List of Datafiles in backup set 18
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 2632443    29-APR-14 +DATA_DG/orcl/datafile/system.256.835611829
  2       Full 2632443    29-APR-14 +DATA_DG/orcl/datafile/undotbs1.258.835611831
  3       Full 2632443    29-APR-14 +DATA_DG/orcl/datafile/sysaux.257.835611829
  4       Full 2632443    29-APR-14 +DATA_DG/orcl/datafile/users.259.835611833
  5       Full 2632443    29-APR-14 +DATA_DG/orcl/datafile/example.269.835611969

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19      Full    1.06M      DISK        00:00:01     29-APR-14      
        BP Key: 19   Status: AVAILABLE  Compressed: YES  Tag: TAG20140429T103607
        Piece Name: /tmp/rman_backup/rman_backup_compressed_21_846153425.data
  Control File Included: Ckp SCN: 2632477      Ckp time: 29-APR-14
  SPFILE Included: Modification time: 29-APR-14

其备份集数据分析
非压缩rman备份集大小:1.55GB
压缩rman备份集大小:328.38MB
==>压缩比例:4.8:1,说明压缩比例很高






0 0
原创粉丝点击