准备:将测试环境的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级别的备份以它为基础进行增量备份,因为它的备份信息里没有相关的增量备份信息。