验证备份前设置CONFIGURE CONTROLFILE AUTOBACKUP ON/OFF; 的区别

关于rman的,
环境:
oracle 10.2.0
rman nocatalog方式
1、首先设置
CONFIGURE CONTROLFILE AUTOBACKUP ON;
然后进行数据库全备份
RMAN> backup database;

Starting backup at 21-APR-10
using channel ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: starting full datafile backupset
channel ORA_SBT_TAPE_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/oracle/oradata/test/system01.dbf
input datafile fno=00003 name=/opt/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/opt/oracle/oradata/test/undotbs01.dbf
input datafile fno=00004 name=/opt/oracle/oradata/test/users01.dbf
input datafile fno=00005 name=/opt/oracle/oradata/test/a1.dbf
channel ORA_SBT_TAPE_1: starting piece 1 at 21-APR-10
channel ORA_SBT_TAPE_1: finished piece 1 at 21-APR-10
piece handle=2ilbml4g_1_1 tag=TAG20100421T162551 comment=API Version 2.0,MMS Version 5.0.0.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:45
Finished backup at 21-APR-10

Starting Control File and SPFILE Autobackup at 21-APR-10
piece handle=c-2011851712-20100421-06 comment=API Version 2.0,MMS Version 5.0.0.0
Finished Control File and SPFILE Autobackup at 21-APR-10

可以看见对controlfile和spfile进行了备份,并且可以验证:
RMAN> list backup of controlfile;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
73      Full    7.00M      SBT_TAPE    00:00:31     21-APR-10      
        BP Key: 73   Status: AVAILABLE  Compressed: NO  Tag: TAG20100421T162007
        Handle: 2hlbmkr5_1_1   Media: @aaaab
  Control File Included: Ckp SCN: 597114       Ckp time: 21-APR-10

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

2、再设置
CONFIGURE CONTROLFILE AUTOBACKUP OFF;

同样的备份

RMAN> backup database;

Starting backup at 21-APR-10
released channel: ORA_DISK_1
using channel ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: starting full datafile backupset
channel ORA_SBT_TAPE_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/oracle/oradata/test/system01.dbf
input datafile fno=00003 name=/opt/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/opt/oracle/oradata/test/undotbs01.dbf
input datafile fno=00004 name=/opt/oracle/oradata/test/users01.dbf
input datafile fno=00005 name=/opt/oracle/oradata/test/a1.dbf
channel ORA_SBT_TAPE_1: starting piece 1 at 21-APR-10
channel ORA_SBT_TAPE_1: finished piece 1 at 21-APR-10
piece handle=2glbmkpn_1_1 tag=TAG20100421T162007 comment=API Version 2.0,MMS Version 5.0.0.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:46
channel ORA_SBT_TAPE_1: starting full datafile backupset
channel ORA_SBT_TAPE_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_SBT_TAPE_1: starting piece 1 at 21-APR-10
channel ORA_SBT_TAPE_1: finished piece 1 at 21-APR-10
piece handle=2hlbmkr5_1_1 tag=TAG20100421T162007 comment=API Version 2.0,MMS Version 5.0.0.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:36
Finished backup at 21-APR-10
好像也对controlfile和spfile进行了备份
验证
RMAN> list backup of controlfile;


List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
73      Full    7.00M      SBT_TAPE    00:00:31     21-APR-10      
        BP Key: 73   Status: AVAILABLE  Compressed: NO  Tag: TAG20100421T162007
        Handle: 2hlbmkr5_1_1   Media: @aaaab
  Control File Included: Ckp SCN: 597114       Ckp time: 21-APR-10

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
75      Full    7.00M      SBT_TAPE    00:00:33     21-APR-10      
        BP Key: 75   Status: AVAILABLE  Compressed: NO  Tag: TAG20100421T162637
        Handle: c-2011851712-20100421-06   Media: @aaaab
  Control File Included: Ckp SCN: 597334       Ckp time: 21-APR-10

两种方式都进行了controlfile和spfile的备份,但不知道其中有何不同?

 
自动备份打开时,会在把数据文件,日志文件,控制文件,SPfile等等都备份完了后,再自动备份一遍当前的控制文件。因为你在上面的备份完成后,控制文件里面记载的信息就发生了变化的,自动备份就会把它备一遍。
自动备份关闭时,就不会最后再备一遍了。
原文地址:https://www.cnblogs.com/login2012/p/5821025.html