oracle 壓縮備份與普通備份從空間,時間,CPU效能的比較

gholay發表於2014-01-12

[oracle@gl ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Jan 12 21:11:15 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DB11G (DBID=299228420)

RMAN> backup database ;

Starting backup at 12-JAN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=45 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=54 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=41 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/data/oradata/DB11G/system01.dbf
input datafile file number=00003 name=/data/oradata/DB11G/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 12-JAN-14
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00002 name=/data/oradata/DB11G/sysaux01.dbf
input datafile file number=00004 name=/data/oradata/DB11G/users01.dbf
channel ORA_DISK_2: starting piece 1 at 12-JAN-14
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_3: starting piece 1 at 12-JAN-14
channel ORA_DISK_3: finished piece 1 at 12-JAN-14
piece handle=/data/flash_recovery_area/DB11G/backupset/2014_01_12/o1_mf_ncnnf_TAG20140112T211144_9f554td8_.bkp tag=TAG20140112T211144 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:24
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_3: starting piece 1 at 12-JAN-14
channel ORA_DISK_3: finished piece 1 at 12-JAN-14
piece handle=/data/flash_recovery_area/DB11G/backupset/2014_01_12/o1_mf_nnsnf_TAG20140112T211144_9f555rco_.bkp tag=TAG20140112T211144 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:33
channel ORA_DISK_2: finished piece 1 at 12-JAN-14
piece handle=/data/flash_recovery_area/DB11G/backupset/2014_01_12/o1_mf_nnndf_TAG20140112T211144_9f554qtm_.bkp tag=TAG20140112T211144 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:02:15
channel ORA_DISK_1: finished piece 1 at 12-JAN-14
piece handle=/data/flash_recovery_area/DB11G/backupset/2014_01_12/o1_mf_nnndf_TAG20140112T211144_9f554l55_.bkp tag=TAG20140112T211144 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:35
Finished backup at 12-JAN-14

正常的全備份需要的時間: 為四個紅色背景的顏色之和 24 + 32 + 135 + 155 = 346 秒



==================================================================================================

RMAN> backup as compressed backupset database ;

Starting backup at 12-JAN-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/data/oradata/DB11G/system01.dbf
input datafile file number=00003 name=/data/oradata/DB11G/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 12-JAN-14
channel ORA_DISK_2: starting compressed full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00002 name=/data/oradata/DB11G/sysaux01.dbf
input datafile file number=00004 name=/data/oradata/DB11G/users01.dbf
channel ORA_DISK_2: starting piece 1 at 12-JAN-14
channel ORA_DISK_3: starting compressed full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_3: starting piece 1 at 12-JAN-14
channel ORA_DISK_3: finished piece 1 at 12-JAN-14
piece handle=/data/flash_recovery_area/DB11G/backupset/2014_01_12/o1_mf_ncnnf_TAG20140112T211902_9f55l9gp_.bkp tag=TAG20140112T211902 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:09
channel ORA_DISK_3: starting compressed full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_3: starting piece 1 at 12-JAN-14
channel ORA_DISK_3: finished piece 1 at 12-JAN-14
piece handle=/data/flash_recovery_area/DB11G/backupset/2014_01_12/o1_mf_nnsnf_TAG20140112T211902_9f55llpd_.bkp tag=TAG20140112T211902 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_2: finished piece 1 at 12-JAN-14
piece handle=/data/flash_recovery_area/DB11G/backupset/2014_01_12/o1_mf_nnndf_TAG20140112T211902_9f55l8yx_.bkp tag=TAG20140112T211902 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:01:42
channel ORA_DISK_1: finished piece 1 at 12-JAN-14
piece handle=/data/flash_recovery_area/DB11G/backupset/2014_01_12/o1_mf_nnndf_TAG20140112T211902_9f55l8c4_.bkp tag=TAG20140112T211902 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:52
Finished backup at 12-JAN-14


可以看出壓縮消費的時間為: 9 + 4 + 104 + 112 = 229 秒

實驗表明:壓縮備份,消耗時間少一些。

====================================================================================================

普通備份:
[root@gl ~]# top 
 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND  
 6582 oracle    18   0  534m  49m  33m D  6.3  4.9   0:01.07 oracle                            
 6580 oracle    18   0  534m  54m  31m D  3.4  5.4   0:01.37 oracle



壓縮備份:
[root@gl ~]# top 
 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND  
 6580 oracle    16   0  549m  69m  41m D 51.1  6.9   0:15.58 oracle                            
 6582 oracle    17   0  549m  65m  42m D 16.2  6.5   0:09.95 oracle     

比較得知: 壓縮備份消耗的CPU比例比較大。


=============================================================================================



普通備份大小查詢:
[root@gl 2014_01_12]# ll
total 275496
-rw-r----- 1 oracle oinstall   1114112 Jan 12 21:24 o1_mf_ncnnf_TAG20140112T212420_9f55w6kk_.bkp
-rw-r----- 1 oracle oinstall 189693952 Jan 12 21:25 o1_mf_nnndf_TAG20140112T212420_9f55w5hj_.bkp
-rw-r----- 1 oracle oinstall  90906624 Jan 12 21:25 o1_mf_nnndf_TAG20140112T212420_9f55w5vf_.bkp
-rw-r----- 1 oracle oinstall     98304 Jan 12 21:24 o1_mf_nnsnf_TAG20140112T212420_9f55wj7t_.bkp


壓縮備份大小查詢:
[root@gl 2014_01_12]# ll
total 1051560
-rw-r----- 1 oracle oinstall   9830400 Jan 12 21:32 o1_mf_ncnnf_TAG20140112T213232_9f56cl3c_.bkp
-rw-r----- 1 oracle oinstall 622133248 Jan 12 21:34 o1_mf_nnndf_TAG20140112T213232_9f56ckdc_.bkp
-rw-r----- 1 oracle oinstall 443662336 Jan 12 21:34 o1_mf_nnndf_TAG20140112T213232_9f56cpvt_.bkp
-rw-r----- 1 oracle oinstall     98304 Jan 12 21:32 o1_mf_nnsnf_TAG20140112T213232_9f56d1gz_.bkp

可以檢視到:比例大約為 1:5

===============================================================================================








來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29196873/viewspace-1069809/,如需轉載,請註明出處,否則將追究法律責任。

相關文章