0級備份和全備份的本質區別

路途中的人2012發表於2016-09-14
準備:將測試環境的users表空間只讀
測試:
1、資料庫0級別備份
RMAN> backup incremental level 0 database tag 'levle0' format '/home/oracle/guo/%U';

Starting backup at 23-MAY-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/PROD1/system01.dbf
input datafile file number=00010 name=/u02/oradata/prod1/test_tbs.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD1/example01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/07q7mo4a_1_1 tag=LEVLE0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/08q7mo5e_1_1 tag=LEVLE0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/PROD1/EXAMPLE.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD1/indx.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/PROD1/TEST.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/PROD1/TOOLS.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/09q7mo5h_1_1 tag=LEVLE0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-MAY-15

Starting Control File and SPFILE Autobackup at 23-MAY-15
piece handle=/home/oracle/flash/PROD1/autobackup/2015_05_23/o1_mf_s_880500914_bp17km40_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 23-MAY-15


備份完成users表空間(只讀)順利備份
2、資料庫1級別備份
RMAN> backup incremental level 1 database tag 'level1' format '/home/oracle/guo/%U';

Starting backup at 23-MAY-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/PROD1/system01.dbf
input datafile file number=00010 name=/u02/oradata/prod1/test_tbs.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD1/example01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/0bq7mo93_1_1 tag=LEVEL1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/0cq7mo94_1_1 tag=LEVEL1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/PROD1/EXAMPLE.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/PROD1/indx.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/PROD1/TEST.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/PROD1/TOOLS.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
skipping datafile 00004 because it has not changed
channel ORA_DISK_1: starting piece 1 at 23-MAY-15
channel ORA_DISK_1: finished piece 1 at 23-MAY-15
piece handle=/home/oracle/guo/0dq7mo96_1_1 tag=LEVEL1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-MAY-15

Starting Control File and SPFILE Autobackup at 23-MAY-15
piece handle=/home/oracle/flash/PROD1/autobackup/2015_05_23/o1_mf_s_880501031_bp17o7q8_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 23-MAY-15

RMAN>


結論:資料庫0級備份是不會丟掉只讀表空間的,只有1級的備份會因為只讀表空間沒有改變所以不會去備份它。
找到官方的說法:

Full
A backup of a datafile that includes every allocated block in the file being backed up. A full backup of a datafile can be an image copy, in which case every data block is backed up. It can also be stored in a backup set, in which case datafile blocks not in use may be skipped, according to rules in Oracle Database Backup and Recovery Reference.

A full backup cannot be part of an incremental backup strategy; that is, it cannot be the parent for a subsequent incremental backup.

Incremental
An incremental backup is either a level 0 backup, which includes every block in the file except blocks compressed out because they have never been used, or a level 1 backup, which includes only those blocks that have been changed since the parent backup was taken.

A level 0 incremental backup is physically identical to a full backup. The only difference is that the level 0 backup is recorded as an incremental backup in the RMAN repository, so it can be used as the parent for a level 1 backup.

 Ps:至於全備份和0級別備份另一個差異,我覺得前面的引用英文說的很清楚了,全備份不能作為0級別備份,讓1級別的備份以它為基礎進行增量備份,因為它的備份資訊裡沒有相關的增量備份資訊。

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

相關文章