OCP课程46:管理II之使用RMAN创建备份

课程目标:

  • 创建镜像拷贝
  • 创建整库备份
  • 创建全备
  • 启用快速增量备份
  • 创建冗余备份集
  • 创建多片备份
  • 创建长期保留归档备份
  • 报告和维护备份

1、创建备份集

clipboard

rman可以使用备份集的方式存储备份,备份集是备份片的集合,一个备份片可能包括一个或者多个数据文件。FORMAT参数备份片文件名的格式,也可以通过ALLOCATE CHANNEL或者CONFIGURE命令指定。

SQL> select tablespace_name,file_name from dba_data_files where tablespace_name='TBS_03';

TABLESPACE_NAME      FILE_NAME

-------------------- --------------------------------------------------

TBS_03               +DATA/stone/datafile/tbs_03.277.900799397

TBS_03               +DATA/stone/datafile/tbs_03.280.900834713

RMAN> backup as backupset

2> format '/home/oracle/df_%d_%s_%p.bus'

3> tablespace tbs_03;

Starting backup at 11-JAN-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=26 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=00015 name=+DATA/stone/datafile/tbs_03.277.900799397

input datafile file number=00016 name=+DATA/stone/datafile/tbs_03.280.900834713

channel ORA_DISK_1: starting piece 1 at 11-JAN-16

channel ORA_DISK_1: finished piece 1 at 11-JAN-16

piece handle=/home/oracle/df_STONE_155_1.bus tag=TAG20160111T075429 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 11-JAN-16

Starting Control File and SPFILE Autobackup at 11-JAN-16

piece handle=+FRA/stone/autobackup/2016_01_11/s_900834871.329.900834873 comment=NONE

Finished Control File and SPFILE Autobackup at 11-JAN-16


2、创建镜像拷贝

clipboard[1]

镜像拷贝是对单个数据文件,归档日志文件或者控制文件的复制,使用BACKUP AS COPY命令或者操作系统命令创建。使用BACKUP AS COPY命令创建会去验证是否有坏块并将备份信息写入到控制文件。

镜像拷贝有如下特性:

只能写入到磁盘,如果文件很多,需较长时间,但是还原时间会缩短。

通过SWITCH命令可以立即使用磁盘上面的镜像拷贝,等同于SQL语句ALTER DATABASE RENAME FILE。

镜像拷贝会负责文件中的所有块,不管这些块有没有数据。同时默认会对这些块进行检查,使用NOCHECKSUM选项设置不检查以提高拷贝的速度。

镜像拷贝可以是全部或者0级备份的一部分。

RMAN> backup as copy datafile 16;

Starting backup at 11-JAN-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

input datafile file number=00016 name=+DATA/stone/datafile/tbs_03.280.900834713

output file name=+FRA/stone/datafile/tbs_03.326.900875863 tag=TAG20160111T191742 RECID=6 STAMP=900875863

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

Finished backup at 11-JAN-16

Starting Control File and SPFILE Autobackup at 11-JAN-16

piece handle=+FRA/stone/autobackup/2016_01_11/s_900875863.325.900875865 comment=NONE

Finished Control File and SPFILE Autobackup at 11-JAN-16


3、创建整库备份

clipboard[2]

整库备份(Whole Database Backup)是所有数据文件和控制文件的备份集或者镜像拷贝。,可以选择包括服务器参数文件和归档日志文件。使用RMAN创建所有数据文件的镜像拷贝只需要加载或者打开数据库,启动rman并输入BACKUP DATABASE PLUS ARCHIVELOG命令。可以使用DELETE INPUT选择在备份完成之后删除已经备份的归档日志文件,例如:

RMAN> BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;

同时需要使用CONFIGURE进行如下配置:

CONFIGURE DEFAULT DEVICE TYPE TO disk;

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY;

CONFIGURE CONTROLFILE AUTOBACKUP ON;

也可以使用如下命令创建先前所有数据文件和控制文件的镜像拷贝的备份:

RMAN> BACKUP COPY OF DATABASE;

RMAN默认是顺序执行每个BACKUP命令,可以通过如下设置并行拷贝操作:

  • 使用CONFIGURE DEVICE TYPE DISK PARALLELISM n命令,n为并行度
  • 分配多个通道
  • 指定一个BACKUP AS COPY命令并列出多个文件

RMAN> configure controlfile autobackup on;

old RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters are successfully stored

RMAN> configure device type disk backup type to copy;

new RMAN configuration parameters:

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY PARALLELISM 1;

new RMAN configuration parameters are successfully stored

released channel: ORA_DISK_1

RMAN> configure default device type to disk;

old RMAN configuration parameters:

CONFIGURE DEFAULT DEVICE TYPE TO DISK;

new RMAN configuration parameters:

CONFIGURE DEFAULT DEVICE TYPE TO DISK;

new RMAN configuration parameters are successfully stored

RMAN> list backup;

specification does not match any backup in the repository

RMAN> list copy;

specification does not match any datafile copy in the repository

specification does not match any control file copy in the repository

specification does not match any archived log in the repository

RMAN> backup database plus archivelog delete input;

Starting backup at 11-JAN-16

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log copy

input archived log thread=1 sequence=118 RECID=118 STAMP=900888563

output file name=/u01/app/oracle/fast_recovery_area/STONE/archivelog/2016_01_11/o1_mf_1_118_c97j7n2l_.arc RECID=119 STAMP=900888564

channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01

channel ORA_DISK_1: deleting archived log(s)

archived log file name=/u01/app/oracle/fast_recovery_area/STONE/archivelog/2016_01_11/o1_mf_1_118_c97j7msn_.arc RECID=118 STAMP=900888563

Finished backup at 11-JAN-16

Starting backup at 11-JAN-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

input datafile file number=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_sysaux_c97j7odz_.dbf tag=TAG20160111T224925 RECID=15 STAMP=900888622

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05

channel ORA_DISK_1: starting datafile copy

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_system_c97j9prw_.dbf tag=TAG20160111T224925 RECID=16 STAMP=900888677

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55

channel ORA_DISK_1: starting datafile copy

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c97jcg2j_.dbf tag=TAG20160111T224925 RECID=17 STAMP=900888702

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25

channel ORA_DISK_1: starting datafile copy

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c97jd7j8_.dbf tag=TAG20160111T224925 RECID=18 STAMP=900888718

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

channel ORA_DISK_1: starting datafile copy

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c97jdgw2_.dbf tag=TAG20160111T224925 RECID=19 STAMP=900888719

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

channel ORA_DISK_1: starting datafile copy

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c97jdj0z_.dbf tag=TAG20160111T224925 RECID=20 STAMP=900888720

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

Finished backup at 11-JAN-16

Starting backup at 11-JAN-16

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log copy

input archived log thread=1 sequence=119 RECID=120 STAMP=900888721

output file name=/u01/app/oracle/fast_recovery_area/STONE/archivelog/2016_01_11/o1_mf_1_119_c97jdkow_.arc RECID=121 STAMP=900888721

channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01

channel ORA_DISK_1: deleting archived log(s)

archived log file name=/u01/app/oracle/fast_recovery_area/STONE/archivelog/2016_01_11/o1_mf_1_119_c97jdkbn_.arc RECID=120 STAMP=900888721

Finished backup at 11-JAN-16

Starting Control File and SPFILE Autobackup at 11-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_11/o1_mf_s_900888722_c97jdm55_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 11-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

26      Full    9.45M      DISK        00:00:01     11-JAN-16     

        BP Key: 32   Status: AVAILABLE  Compressed: NO  Tag: TAG20160111T225202

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_11/o1_mf_s_900888722_c97jdm55_.bkp

  SPFILE Included: Modification time: 11-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3598756      Ckp time: 11-JAN-16

RMAN> list copy;

specification does not match any control file copy in the repository

List of Datafile Copies

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

Key     File S Completion Time Ckp SCN    Ckp Time      

------- ---- - --------------- ---------- ---------------

16      1    A 11-JAN-16       3598672    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_system_c97j9prw_.dbf

        Tag: TAG20160111T224925

15      2    A 11-JAN-16       3598619    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_sysaux_c97j7odz_.dbf

        Tag: TAG20160111T224925

18      3    A 11-JAN-16       3598736    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c97jd7j8_.dbf

        Tag: TAG20160111T224925

20      4    A 11-JAN-16       3598742    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c97jdj0z_.dbf

        Tag: TAG20160111T224925

17      5    A 11-JAN-16       3598706    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c97jcg2j_.dbf

        Tag: TAG20160111T224925

19      7    A 11-JAN-16       3598740    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c97jdgw2_.dbf

        Tag: TAG20160111T224925

List of Archived Log Copies for database with db_unique_name STONE

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

Key     Thrd Seq     S Low Time

------- ---- ------- - ---------

119     1    118     A 11-JAN-16

        Name: /u01/app/oracle/fast_recovery_area/STONE/archivelog/2016_01_11/o1_mf_1_118_c97j7n2l_.arc

121     1    119     A 11-JAN-16

        Name: /u01/app/oracle/fast_recovery_area/STONE/archivelog/2016_01_11/o1_mf_1_119_c97jdkow_.arc

RMAN> backup copy of database;

Starting backup at 11-JAN-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

input is copy of datafile 00002: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_sysaux_c97j7odz_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_sysaux_c97jkx8v_.dbf tag=TAG20160111T224925 RECID=21 STAMP=900888940

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55

channel ORA_DISK_1: starting datafile copy

input is copy of datafile 00001: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_system_c97j9prw_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_system_c97jmno3_.dbf tag=TAG20160111T224925 RECID=22 STAMP=900888992

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:46

channel ORA_DISK_1: starting datafile copy

input is copy of datafile 00005: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c97jcg2j_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c97jo2h8_.dbf tag=TAG20160111T224925 RECID=23 STAMP=900889019

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25

channel ORA_DISK_1: starting datafile copy

input is copy of datafile 00003: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c97jd7j8_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c97jow0v_.dbf tag=TAG20160111T224925 RECID=24 STAMP=900889026

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:08

channel ORA_DISK_1: starting datafile copy

input is copy of datafile 00007: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c97jdgw2_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c97jp3nt_.dbf tag=TAG20160111T224925 RECID=25 STAMP=900889028

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

channel ORA_DISK_1: starting datafile copy

input is copy of datafile 00004: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c97jdj0z_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c97jp4rz_.dbf tag=TAG20160111T224925 RECID=26 STAMP=900889029

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

Finished backup at 11-JAN-16

Starting Control File and SPFILE Autobackup at 11-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_11/o1_mf_s_900889030_c97jp698_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 11-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

26      Full    9.45M      DISK        00:00:01     11-JAN-16     

        BP Key: 32   Status: AVAILABLE  Compressed: NO  Tag: TAG20160111T225202

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_11/o1_mf_s_900888722_c97jdm55_.bkp

  SPFILE Included: Modification time: 11-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3598756      Ckp time: 11-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

27      Full    9.45M      DISK        00:00:00     11-JAN-16     

        BP Key: 33   Status: AVAILABLE  Compressed: NO  Tag: TAG20160111T225709

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_11/o1_mf_s_900889030_c97jp698_.bkp

  SPFILE Included: Modification time: 11-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3599063      Ckp time: 11-JAN-16

RMAN> list copy;

specification does not match any control file copy in the repository

List of Datafile Copies

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

Key     File S Completion Time Ckp SCN    Ckp Time      

------- ---- - --------------- ---------- ---------------

22      1    A 11-JAN-16       3598672    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_system_c97jmno3_.dbf

        Tag: TAG20160111T224925

21      2    A 11-JAN-16       3598619    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_sysaux_c97jkx8v_.dbf

        Tag: TAG20160111T224925

24      3    A 11-JAN-16       3598736    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c97jow0v_.dbf

        Tag: TAG20160111T224925

18      3    A 11-JAN-16       3598736    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c97jd7j8_.dbf

        Tag: TAG20160111T224925

26      4    A 11-JAN-16       3598742    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c97jp4rz_.dbf

        Tag: TAG20160111T224925

20      4    A 11-JAN-16       3598742    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c97jdj0z_.dbf

        Tag: TAG20160111T224925

23      5    A 11-JAN-16       3598706    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c97jo2h8_.dbf

        Tag: TAG20160111T224925

17      5    A 11-JAN-16       3598706    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c97jcg2j_.dbf

        Tag: TAG20160111T224925

25      7    A 11-JAN-16       3598740    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c97jp3nt_.dbf

        Tag: TAG20160111T224925

19      7    A 11-JAN-16       3598740    11-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c97jdgw2_.dbf

        Tag: TAG20160111T224925

List of Archived Log Copies for database with db_unique_name STONE

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

Key     Thrd Seq     S Low Time

------- ---- ------- - ---------

121     1    119     A 11-JAN-16

        Name: /u01/app/oracle/fast_recovery_area/STONE/archivelog/2016_01_11/o1_mf_1_119_c97jdkow_.arc


4、RMAN备份类型

clipboard[3]

RMAN备份类型:

  • 全备(Full Backups):不同于整备(Whole Backup),全备包括所有使用过的数据文件块,跳过从来没有用过的数据文件块,复制到备份集或者镜像拷贝。
  • 增量备份(Incremental Backups):包括0级增量备份和1级增量备份,0级增量备份等同于全备,包括所有使用过的数据文件块,但可以作为1级增量备份的基础,1级增量备份包括自上次备份后改变过的块。在BACKUP命令使用INCREMENTAL LEVEL [0|1]指定增量备份。

1级增量备份有2种:

  • 差异(Differential):默认类型,对最近一次0级或者1级备份后改变的块进行备份
  • 累积(Cumulative):对最近一次0级备份后改变的块进行备份

例如:

执行0级增量备份:RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE;

执行差异增量备份:RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE;

执行累积增量备份:RMAN> BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;

如果没有指定FULL或者INCREMENTAL,则默认执行全备,不能作为增量备份的基础,然而完整镜像拷贝可以通过使用RECOVER命令应用增量备份进行增量更新。

如果数据库没有打开,可以在NOARCHIVELOG模式进行任何类型的备份(全部或者增备)。

RMAN> list backup;

specification does not match any backup in the repository

RMAN> list copy;

specification does not match any datafile copy in the repository

specification does not match any control file copy in the repository

specification does not match any archived log in the repository

RMAN> backup incremental level 0 database;

Starting backup at 12-JAN-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

input datafile file number=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_sysaux_c98l9nf4_.dbf tag=TAG20160112T083044 RECID=27 STAMP=900923499

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55

channel ORA_DISK_1: starting datafile copy

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_system_c98lccrp_.dbf tag=TAG20160112T083044 RECID=28 STAMP=900923540

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45

channel ORA_DISK_1: starting datafile copy

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c98lds0k_.dbf tag=TAG20160112T083044 RECID=29 STAMP=900923556

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:16

channel ORA_DISK_1: starting datafile copy

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c98lf894_.dbf tag=TAG20160112T083044 RECID=30 STAMP=900923566

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

channel ORA_DISK_1: starting datafile copy

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c98lfhfh_.dbf tag=TAG20160112T083044 RECID=31 STAMP=900923567

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

channel ORA_DISK_1: starting datafile copy

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

output file name=/u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c98lfjlc_.dbf tag=TAG20160112T083044 RECID=32 STAMP=900923568

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900923569_c98lfl2z_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

28      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 34   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T083249

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900923569_c98lfl2z_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3603414      Ckp time: 12-JAN-16

RMAN> list copy;

specification does not match any control file copy in the repository

specification does not match any archived log in the repository

List of Datafile Copies

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

Key     File S Completion Time Ckp SCN    Ckp Time      

------- ---- - --------------- ---------- ---------------

28      1    A 12-JAN-16       3603354    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_system_c98lccrp_.dbf

        Tag: TAG20160112T083044

27      2    A 12-JAN-16       3603256    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_sysaux_c98l9nf4_.dbf

        Tag: TAG20160112T083044

30      3    A 12-JAN-16       3603403    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c98lf894_.dbf

        Tag: TAG20160112T083044

32      4    A 12-JAN-16       3603408    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c98lfjlc_.dbf

        Tag: TAG20160112T083044

29      5    A 12-JAN-16       3603396    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c98lds0k_.dbf

        Tag: TAG20160112T083044

31      7    A 12-JAN-16       3603407    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c98lfhfh_.dbf

        Tag: TAG20160112T083044

RMAN> backup incremental level 1 database;

Starting backup at 12-JAN-16

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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T083629_c98lng5q_.bkp tag=TAG20160112T083629 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900923905_c98lr2r9_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

28      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 34   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T083249

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900923569_c98lfl2z_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3603414      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

29      Incr 1  1.93M      DISK        00:01:54     12-JAN-16     

        BP Key: 35   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T083629

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T083629_c98lng5q_.bkp

  List of Datafiles in backup set 29

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

30      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 36   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T083825

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900923905_c98lr2r9_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3603722      Ckp time: 12-JAN-16

RMAN> list copy;

specification does not match any control file copy in the repository

specification does not match any archived log in the repository

List of Datafile Copies

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

Key     File S Completion Time Ckp SCN    Ckp Time      

------- ---- - --------------- ---------- ---------------

28      1    A 12-JAN-16       3603354    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_system_c98lccrp_.dbf

        Tag: TAG20160112T083044

27      2    A 12-JAN-16       3603256    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_sysaux_c98l9nf4_.dbf

        Tag: TAG20160112T083044

30      3    A 12-JAN-16       3603403    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_undotbs1_c98lf894_.dbf

        Tag: TAG20160112T083044

32      4    A 12-JAN-16       3603408    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_users_c98lfjlc_.dbf

        Tag: TAG20160112T083044

29      5    A 12-JAN-16       3603396    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_example_c98lds0k_.dbf

        Tag: TAG20160112T083044

31      7    A 12-JAN-16       3603407    12-JAN-16     

        Name: /u01/app/oracle/fast_recovery_area/STONE/datafile/o1_mf_rcat_ts_c98lfhfh_.dbf

        Tag: TAG20160112T083044

RMAN> backup incremental level 1 cumulative database;

Starting backup at 12-JAN-16

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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T084519_c98m507j_.bkp tag=TAG20160112T084519 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900924435_c98m8n10_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

28      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 34   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T083249

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900923569_c98lfl2z_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3603414      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

29      Incr 1  1.93M      DISK        00:01:54     12-JAN-16     

        BP Key: 35   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T083629

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T083629_c98lng5q_.bkp

  List of Datafiles in backup set 29

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    1  Incr 3603636    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

30      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 36   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T083825

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900923905_c98lr2r9_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3603722      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

31      Incr 1  2.38M      DISK        00:01:46     12-JAN-16     

        BP Key: 37   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T084519

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T084519_c98m507j_.bkp

  List of Datafiles in backup set 31

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    1  Incr 3604558    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    1  Incr 3604558    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    1  Incr 3604558    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    1  Incr 3604558    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    1  Incr 3604558    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    1  Incr 3604558    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

32      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 38   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T084715

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900924435_c98m8n10_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3604651      Ckp time: 12-JAN-16

RMAN> show device type;

RMAN configuration parameters for database with db_unique_name STONE are:

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY PARALLELISM 1;

RMAN> configure device type disk backup type to backupset;

old RMAN configuration parameters:

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY PARALLELISM 1;

new RMAN configuration parameters:

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET PARALLELISM 1;

new RMAN configuration parameters are successfully stored

RMAN> delete backup;

RMAN> delete copy;

RMAN> list backup;

specification does not match any backup in the repository

RMAN> list copy;

specification does not match any datafile copy in the repository

specification does not match any control file copy in the repository

specification does not match any archived log in the repository

RMAN> backup incremental level 0 database;

Starting backup at 12-JAN-16

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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd0_TAG20160112T091936_c98o58oo_.bkp tag=TAG20160112T091936 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:15

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900926511_c98o9j1j_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

33      Incr 0  1.42G      DISK        00:02:09     12-JAN-16     

        BP Key: 39   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T091936

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd0_TAG20160112T091936_c98o58oo_.bkp

  List of Datafiles in backup set 33

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

34      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 40   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T092151

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900926511_c98o9j1j_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3606793      Ckp time: 12-JAN-16

RMAN> list copy;

specification does not match any datafile copy in the repository

specification does not match any control file copy in the repository

specification does not match any archived log in the repository

RMAN> backup incremental level 1 database;

Starting backup at 12-JAN-16

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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T092515_c98ohw5c_.bkp tag=TAG20160112T092515 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900926830_c98omgss_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

33      Incr 0  1.42G      DISK        00:02:09     12-JAN-16     

        BP Key: 39   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T091936

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd0_TAG20160112T091936_c98o58oo_.bkp

  List of Datafiles in backup set 33

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

34      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 40   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T092151

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900926511_c98o9j1j_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3606793      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

35      Incr 1  1.22M      DISK        00:01:46     12-JAN-16     

        BP Key: 41   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T092515

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T092515_c98ohw5c_.bkp

  List of Datafiles in backup set 35

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

36      Full    9.45M      DISK        00:00:00     12-JAN-16     

        BP Key: 42   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T092710

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900926830_c98omgss_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3607104      Ckp time: 12-JAN-16

RMAN> backup incremental level 1 cumulative database;

Starting backup at 12-JAN-16

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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T093506_c98p2cbo_.bkp tag=TAG20160112T093506 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900927412_c98p5no8_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

33      Incr 0  1.42G      DISK        00:02:09     12-JAN-16     

        BP Key: 39   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T091936

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd0_TAG20160112T091936_c98o58oo_.bkp

  List of Datafiles in backup set 33

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    0  Incr 3606653    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

34      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 40   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T092151

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900926511_c98o9j1j_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3606793      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

35      Incr 1  1.22M      DISK        00:01:46     12-JAN-16     

        BP Key: 41   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T092515

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T092515_c98ohw5c_.bkp

  List of Datafiles in backup set 35

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    1  Incr 3607008    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

36      Full    9.45M      DISK        00:00:00     12-JAN-16     

        BP Key: 42   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T092710

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900926830_c98omgss_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3607104      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

37      Incr 1  2.45M      DISK        00:01:39     12-JAN-16     

        BP Key: 43   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T093506

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T093506_c98p2cbo_.bkp

  List of Datafiles in backup set 37

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    1  Incr 3607540    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    1  Incr 3607540    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    1  Incr 3607540    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    1  Incr 3607540    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    1  Incr 3607540    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    1  Incr 3607540    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

38      Full    9.45M      DISK        00:00:00     12-JAN-16     

        BP Key: 44   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T093652

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900927412_c98p5no8_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3607774      Ckp time: 12-JAN-16


5、快速增量备份

clipboard[4]

通过使用块改变跟踪进行快速增量备份,块改变跟踪文件记录变化块的物理地址,进行备份的时候就不需要扫描每一个块了,直接根据块改变跟踪文件定位变化的块,加快增量备份。

Oracle自动维护块改变跟踪文件,块改变跟踪文件参考以下:

  • 数据库大小
  • RAC的线程数
  • 块改变跟踪文件维护的备份数量

块改变跟踪文件最小为10M,增量为10M,数据库默认不记录块改变信息。


6、启用快速增量备份

clipboard[5]

可以通过EM启用块改变跟踪,如果设置了DB_CREATE_FILE_DEST初始化参数,则不需要指定块改变跟踪文件位置,当然也可以指定到其他位置。

可以通过ALTER DATABASE语句启用和停用块改变跟踪,启用会自动在DB_CREATE_FILE_DEST指定的位置创建目录和块改变跟踪文件,停用会自动删除文件。可以通过ALTER DATABASE RENAME命令在MOUNT状态重命名块改变跟踪文件。可以使用ALTER DATABASE RENAME FILE '...' TO '...' 改变文件位置。

RMAN不支持备份和恢复块改变跟踪文件,故不要将其放入快速恢复区。

例子:启用和停用块改变跟踪

SQL> show parameter db_create_file_dest;

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

db_create_file_dest                  string      /u01/app/oracle/oradata

SQL> alter database enable block change tracking;

Database altered.

SQL> !ls /u01/app/oracle/oradata/STONE/changetracking/

o1_mf_c98obb33_.chg

SQL> alter database disable block change tracking;

Database altered.

SQL> !ls /u01/app/oracle/oradata/STONE/changetracking/

SQL>


7、监控块改变跟踪

clipboard[6]

视图V$BLOCK_CHANGE_TRACKING显示块改变跟踪文件的位置,状态,大小等。

视图V$BACKUP_DATAFILE可以计算块改变跟踪在最小化增量备份I/O上起的作用。比较大的值表示在增量备份的时候读取了数据文件的很多块。

先启用块改变跟踪

SQL> alter database enable block change tracking;

Database altered.

SQL> select filename,status,bytes from v$block_change_tracking;

FILENAME                                                               STATUS          BYTES

---------------------------------------------------------------------- ---------- ----------

/u01/app/oracle/oradata/STONE/changetracking/o1_mf_c98v5ocs_.chg       ENABLED      11599872

RMAN> delete backup;

RMAN> list backup;

specification does not match any backup in the repository

RMAN> backup incremental level 0 database;

Starting backup at 12-JAN-16

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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd0_TAG20160112T110829_c98vkfbr_.bkp tag=TAG20160112T110829 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:15

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900933044_c98vonwh_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> backup incremental level 1 database;

Starting backup at 12-JAN-16

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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnnd1_TAG20160112T111141_c98vqgq8_.bkp tag=TAG20160112T111141 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900933109_c98vqpcc_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

SQL> select file#,avg(datafile_blocks),avg(blocks_read),avg(blocks_read/datafile_blocks)*100 as pct_read_for_backup,avg(blocks)

  2  from v$backup_datafile

  3  where used_change_tracking='YES' and incremental_level>0

  4  group by file#;

     FILE# AVG(DATAFILE_BLOCKS) AVG(BLOCKS_READ) PCT_READ_FOR_BACKUP AVG(BLOCKS)

---------- -------------------- ---------------- ------------------- -----------

         1                98560               81          .082183442          27

         2               110080              561           .50962936          91

         5                44320                1          .002256318           1

         4                  960                1          .104166667           1

         3                14720              181          1.22961957          36

         7                 1920                1          .052083333           1

6 rows selected.


8、执行代理拷贝

clipboard[7]

在BACKUP中使用PROXY选项需要MML执行复制文件。

语法:

BACKUP [AS BACKUPSET] … PROXY [ONLY] DATABASE|TABLESPACE....


9、使用BACKUP COPIES命令创建冗余备份集

clipboard[8]

使用COPIES选项的BACKUP命令可以覆盖其他COPIES或者DUPLES设置,创建冗余备份集,且不能创建在快速恢复区。

使用BACKUP COPIES创建冗余备份,执行以下步骤:

(1)使用COPIES选择指定备份数量

(2)使用LIST BACKUP命令查看

RMAN> delete backup;

RMAN> list backup;

specification does not match any backup in the repository

RMAN> backup as backupset copies 2 incremental level 0 database format '/home/oracle/backup/%U';

Starting backup at 12-JAN-16

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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16 with 2 copies and tag TAG20160112T113017

piece handle=/home/oracle/backup/2qqr6ai9_1_1 comment=NONE

piece handle=/home/oracle/backup/2qqr6ai9_1_2 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:35

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900934372_c98wz4q4_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size

------- ---- -- ----------

43      Incr 0  1.42G

  List of Datafiles in backup set 43

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1    0  Incr 3614834    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2    0  Incr 3614834    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3    0  Incr 3614834    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4    0  Incr 3614834    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5    0  Incr 3614834    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7    0  Incr 3614834    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

  Backup Set Copy #1 of backup set 43

  Device Type Elapsed Time Completion Time Compressed Tag

  ----------- ------------ --------------- ---------- ---

  DISK        00:02:32     12-JAN-16       NO         TAG20160112T113017

    List of Backup Pieces for backup set 43 Copy #1

    BP Key  Pc# Status      Piece Name

    ------- --- ----------- ----------

    49      1   AVAILABLE   /home/oracle/backup/2qqr6ai9_1_1

  Backup Set Copy #2 of backup set 43

  Device Type Elapsed Time Completion Time Compressed Tag

  ----------- ------------ --------------- ---------- ---

  DISK        00:02:32     12-JAN-16       NO         TAG20160112T113017

    List of Backup Pieces for backup set 43 Copy #2

    BP Key  Pc# Status      Piece Name

    ------- --- ----------- ----------

    50      1   AVAILABLE   /home/oracle/backup/2qqr6ai9_1_2

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

44      Full    9.45M      DISK        00:00:00     12-JAN-16     

        BP Key: 51   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T113252

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900934372_c98wz4q4_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3615011      Ckp time: 12-JAN-16


10、创建备份集的备份

clipboard[9]

使用BACKUP BACKUPSET对备份集进行备份,只能对创建在设备类型为DISK的备份集进行备份,可以备份到任何可用设备类型。

RMAN> delete backup;

RMAN> list backup;

specification does not match any backup in the repository

RMAN> backup as backupset device type disk database;

Starting backup at 12-JAN-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T114054_c98xg7d2_.bkp tag=TAG20160112T114054 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:05

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900934980_c98xl4ov_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> backup device type disk backupset all;

Starting backup at 12-JAN-16

using channel ORA_DISK_1

channel ORA_DISK_1: input backup set: count=92, stamp=900934855, piece=1

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: backup piece /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T114054_c98xg7d2_.bkp

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T114054_c98xn3j0_.bkp comment=NONE

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

channel ORA_DISK_1: backup piece complete, elapsed time: 00:01:05

channel ORA_DISK_1: input backup set: count=93, stamp=900934980, piece=1

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

skipping backup piece handle /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900934980_c98xl4ov_.bkp; already exists

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:00

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900935108_c98xp528_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size

------- ---- -- ----------

45      Full    1.42G

  List of Datafiles in backup set 45

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1       Full 3615552    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2       Full 3615552    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3       Full 3615552    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4       Full 3615552    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5       Full 3615552    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7       Full 3615552    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

  Backup Set Copy #1 of backup set 45

  Device Type Elapsed Time Completion Time Compressed Tag

  ----------- ------------ --------------- ---------- ---

  DISK        00:02:04     12-JAN-16       NO         TAG20160112T114054

    List of Backup Pieces for backup set 45 Copy #1

    BP Key  Pc# Status      Piece Name

    ------- --- ----------- ----------

    52      1   AVAILABLE   /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T114054_c98xg7d2_.bkp

  Backup Set Copy #2 of backup set 45

  Device Type Elapsed Time Completion Time Compressed Tag

  ----------- ------------ --------------- ---------- ---

  DISK        00:02:04     12-JAN-16       NO         TAG20160112T114054

    List of Backup Pieces for backup set 45 Copy #2

    BP Key  Pc# Status      Piece Name

    ------- --- ----------- ----------

    54      1   AVAILABLE   /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T114054_c98xn3j0_.bkp

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

46      Full    9.45M      DISK        00:00:00     12-JAN-16     

        BP Key: 53   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T114300

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900934980_c98xl4ov_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3615643      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

47      Full    9.45M      DISK        00:00:01     12-JAN-16     

        BP Key: 55   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T114508

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900935108_c98xp528_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3615751      Ckp time: 12-JAN-16


11、备份只读表空间

clipboard[10]

只有在只读表空间不存在于满足保留策略的备份中,备份优化设置才会让rman对其进行备份。

如果修改了表空间的读写状态,则建议立即进行备份。

可以使用BACKUP命令的SKIP READONLY选项跳过只读表空间或者数据库文件。

例子:满足保留策略情况下的跳过只读表空间

RMAN> delete backup;

RMAN> list backup;

specification does not match any backup in the repository

RMAN> show backup optimization;

RMAN configuration parameters for database with db_unique_name STONE are:

CONFIGURE BACKUP OPTIMIZATION OFF;

RMAN> configure backup optimization on;

old RMAN configuration parameters:

CONFIGURE BACKUP OPTIMIZATION OFF;

new RMAN configuration parameters:

CONFIGURE BACKUP OPTIMIZATION ON;

new RMAN configuration parameters are successfully stored

SQL> alter tablespace example read only;

Tablespace altered.

RMAN> backup database;

Starting backup at 12-JAN-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=48 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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T183047_c99ogr3v_.bkp tag=TAG20160112T183047 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:47

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900959615_c99on091_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> backup database;

Starting backup at 12-JAN-16

using channel ORA_DISK_1

skipping datafile 5; already backed up 2 time(s)

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T183414_c99oo6hl_.bkp tag=TAG20160112T183414 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:16

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900959790_c99osgdj_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

62      Full    1.42G      DISK        00:02:10     12-JAN-16     

        BP Key: 70   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T130252

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T130252_c99280bo_.bkp

  List of Datafiles in backup set 62

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1       Full 3620850    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2       Full 3620850    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3       Full 3620850    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4       Full 3620850    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5       Full 3618687    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7       Full 3620850    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

63      Full    9.52M      DISK        00:00:05     12-JAN-16     

        BP Key: 71   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T130508

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900939908_c992d910_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3620994      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

64      Full    1.42G      DISK        00:02:44     12-JAN-16     

        BP Key: 72   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T183047

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T183047_c99ogr3v_.bkp

  List of Datafiles in backup set 64

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1       Full 3641178    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2       Full 3641178    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3       Full 3641178    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4       Full 3641178    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5       Full 3618687    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7       Full 3641178    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

65      Full    9.52M      DISK        00:00:01     12-JAN-16     

        BP Key: 73   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T183335

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900959615_c99on091_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3641367      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

66      Full    1.36G      DISK        00:02:14     12-JAN-16     

        BP Key: 74   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T183414

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T183414_c99oo6hl_.bkp

  List of Datafiles in backup set 66

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1       Full 3641407    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2       Full 3641407    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3       Full 3641407    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4       Full 3641407    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  7       Full 3641407    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

67      Full    9.52M      DISK        00:00:00     12-JAN-16     

        BP Key: 75   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T183630

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900959790_c99osgdj_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3641508      Ckp time: 12-JAN-16

例子:使用SKIP跳过只读表空间

RMAN> delete backup;

RMAN> list backup;

specification does not match any backup in the repository

RMAN> backup database skip readonly;

Starting backup at 12-JAN-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=53 device type=DISK

skipping read-only file 5

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T185525_c99pwy64_.bkp tag=TAG20160112T185525 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:36

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900961081_c99q1tlv_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16


12、为大文件配置备份和恢复

clipboard[11]

Oracle数据文件最大可以到128TB,可以将大文件分段备份和还原,只能用于备份集,不能用于镜像拷贝。通过并行的方式进行分段备份可以提高性能。一般除了最后一个备份段,备份段的大小一致,一个文件最多256个备份段。


13、创建RMAN多段备份

clipboard[12]

BACKUP和VALIDATE DATAFILE命令可以使用以下选项:

SECTION SIZE [K | M | G]

用来指定每个备份段的大小,也可以为不同文件指定不同备份段的大小。上图中对数据文件5进行备份,指定每个备份段的大小为25M,同时保持块的连续性。

查看分段备份:

通过V$BACKUP_SET和RC_BACKUP_SET视图的MULTI_SECTION字段查看是否是分段备份

通过V$BACKUP_DATAFILE和RC_BACKUP_DATAFILE视图的SETTION_SIZE字段查看分段备份中每段的块数量,0表示整个文件备份。

SQL> select recid,multi_section from v$backup_set;

     RECID MUL

---------- ---

        68 NO

        69 NO

SQL> select file#,section_size from v$backup_datafile order by 1;

     FILE# SECTION_SIZE

---------- ------------

         0            0

         1            0

         2            0

         3            0

         4            0

         7            0

6 rows selected.

RMAN> backup datafile 5 section size=100M tag 'section100mb';

Starting backup at 12-JAN-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

backing up blocks 1 through 12800

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_SECTION100MB_c99rhby7_.bkp tag=SECTION100MB comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

backing up blocks 12801 through 25600

channel ORA_DISK_1: starting piece 2 at 12-JAN-16

channel ORA_DISK_1: finished piece 2 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_SECTION100MB_c99rhfyy_.bkp tag=SECTION100MB comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

backing up blocks 25601 through 38400

channel ORA_DISK_1: starting piece 3 at 12-JAN-16

channel ORA_DISK_1: finished piece 3 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_SECTION100MB_c99rhk4l_.bkp tag=SECTION100MB comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

backing up blocks 38401 through 44320

channel ORA_DISK_1: starting piece 4 at 12-JAN-16

channel ORA_DISK_1: finished piece 4 at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_SECTION100MB_c99rhn9f_.bkp tag=SECTION100MB comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 12-JAN-16

Starting Control File and SPFILE Autobackup at 12-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900962549_c99rholg_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 12-JAN-16

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

70      Full    68.95M     DISK        00:00:10     12-JAN-16     

  List of Datafiles in backup set 70

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  5       Full 3618687    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  Backup Set Copy #1 of backup set 70

  Device Type Elapsed Time Completion Time Compressed Tag

  ----------- ------------ --------------- ---------- ---

  DISK        00:00:10     12-JAN-16       NO         SECTION100MB

    List of Backup Pieces for backup set 70 Copy #1

    BP Key  Pc# Status      Piece Name

    ------- --- ----------- ----------

    78      1   AVAILABLE   /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_SECTION100MB_c99rhby7_.bkp

    79      2   AVAILABLE   /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_SECTION100MB_c99rhfyy_.bkp

    80      3   AVAILABLE   /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_SECTION100MB_c99rhk4l_.bkp

    81      4   AVAILABLE   /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_SECTION100MB_c99rhn9f_.bkp

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

71      Full    9.52M      DISK        00:00:00     12-JAN-16     

        BP Key: 82   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T192229

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900962549_c99rholg_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3644072      Ckp time: 12-JAN-16

SQL> select recid,multi_section from v$backup_set;

     RECID MUL

---------- ---

        70 YES

        71 NO

SQL> select file#,section_size from v$backup_datafile order by 1;

     FILE# SECTION_SIZE

---------- ------------

         0            0

         5        12800


14、存档备份:概念

clipboard[13]

如果需要恢复到从备份到当前这段时间的任何时间点(point-in-time recovery),那么就需要这段时间所有的归档日志文件。

还有一种需求,就是将备份保留足够长的时间,只是需要恢复到备份的时候,而不需要恢复到某个时间点,可以通过存档备份来解决。如果标记一个备份为存档,则会覆盖其他保留策略,保留备份到指定的时间或者永久。

使用KEEP语句创建存档备份,可以看作数据库在某个时间点上的快照。所需要的仅是恢复备份到一致状态的重做日志,在备份完成后使用RESTORE POINT语句指定需要保留的重做日志数量(足够恢复备份到RESTORE POINT)。

存档备份还保证了恢复备份所需的所有文件,包括数据文件,SPFILE,归档日志文件(只需要恢复联机备份的那些)以及相关的自动备份文件,所有这些文件必须位于同一种介质(或者一组磁带)。

可以指定创建一个还原点,与存档备份有相同的SCN,相当于为这个备份时间点指定一个有意义的名字。

存储备份不受保留窗口以及DELETE OBSOLETE命令的影响,是数据库在某个时间点的快照,可以还原到另外的数据库用于测试。

存档备份不能写入快速恢复区,需要使用FORMAT语句指定位置。


15、使用EM创建存档备份

clipboard[14]

使用EM创建一个存档备份,执行以下步骤:

(1)选择可用性>调度备份>调度定制备份。

(2)在设置页面点击“覆盖默认设置”。在“策略”选项卡。在覆盖保留策略部分,选择“将此备份保留指定的天数”,并指定天数。将会基于job名称生成一个还原点。在“设备”选项卡指定备份的位置。

使用KEEP选项创建的备份包括SPFILE,控制文件,数据文件以及还原这个备份需要的归档日志文件。

clipboard[15]

clipboard[16]

clipboard[17]

clipboard[18]

clipboard[19]


16、使用RMAN创建存档备份

clipboard[20]

RMAN使用下面的语法创建存档备份:

BACKUP ... KEEP {FOREVER|UNTIL TIME 'SYSDATE + '} RESTORE POINT

可以使用UNTIL TIME指定保留时间,也可以使用FOREVER指定备份永不过期。可以使用RESTORE POINT指定还原点名称,实际上就是数据文件备份完成后捕获的SCN的名称,存档备份可以还原和恢复到这个时间点并使数据库打开。

RMAN> delete backup;

RMAN> list backup;

specification does not match any backup in the repository

RMAN> list restore point all;

SCN              RSP Time  Type       Time      Name

---------------- --------- ---------- --------- ----

RMAN> backup database keep until time 'sysdate+365' restore point '%RESTORE_POINT' format '/home/oracle/backup/%U';

Starting backup at 12-JAN-16

current log archived

using channel ORA_DISK_1

backup will be obsolete on date 11-JAN-17

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/home/oracle/backup/3uqr7fkk_1_1 tag=TAG20160112T220256 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:03:46

using channel ORA_DISK_1

backup will be obsolete on date 11-JAN-17

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/home/oracle/backup/3vqr7frm_1_1 tag=TAG20160112T220256 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

current log archived

using channel ORA_DISK_1

backup will be obsolete on date 11-JAN-17

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=124 RECID=126 STAMP=900972409

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/home/oracle/backup/40qr7frp_1_1 tag=TAG20160112T220256 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

using channel ORA_DISK_1

backup will be obsolete on date 11-JAN-17

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

channel ORA_DISK_1: starting piece 1 at 12-JAN-16

channel ORA_DISK_1: finished piece 1 at 12-JAN-16

piece handle=/home/oracle/backup/41qr7frr_1_1 tag=TAG20160112T220256 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 12-JAN-16

RMAN> list restore point all;

SCN              RSP Time  Type       Time      Name

---------------- --------- ---------- --------- ----

3656190                               12-JAN-16 %RESTORE_POINT


17、管理归档数据库备份

clipboard[21]

使用CHANGE命令改变备份是否适用于保留策略。

上图中第一个例子将备份修改为不适用于保留策略,永久保存。

上图中第二个例子将数据文件和控制文件的镜像拷贝修改为适用于保留策略。

[oracle@oracletest ~]$ rman target / catalog rcowner/rcowner

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Jan 12 22:16:17 2016

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

connected to target database: STONE (DBID=3001485737)

connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

RMAN> resync catalog;

starting full resync of recovery catalog

full resync complete

RMAN> change backup tag 'TAG20160112T220256' keep forever;

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=70 device type=DISK

keep attributes for the backup are changed

backup will never be obsolete

backup set key=1816 RECID=72 STAMP=900972401

keep attributes for the backup are changed

backup will never be obsolete

backup set key=1817 RECID=73 STAMP=900972406

keep attributes for the backup are changed

backup will never be obsolete

backup set key=1818 RECID=74 STAMP=900972410

keep attributes for the backup are changed

backup will never be obsolete

backup set key=1819 RECID=75 STAMP=900972412

RMAN> change backup nokeep;

using channel ORA_DISK_1

keep attributes for the backup are deleted

backup set key=1816 RECID=72 STAMP=900972401

keep attributes for the backup are deleted

backup set key=1817 RECID=73 STAMP=900972406

keep attributes for the backup are deleted

backup set key=1818 RECID=74 STAMP=900972410

keep attributes for the backup are deleted

backup set key=1819 RECID=75 STAMP=900972412


18、备份恢复文件

clipboard[22]

有2种方式备份恢复数据:

BACKUP RECOVERY AREA命令备份快速恢复区中的所有文件到磁带。

BACKUP RECOVERY FILES命令备份所有的恢复文件到磁带,包括不在快速恢复区中的。

默认情况下,备份优化对这2个命令起作用,即使使用CONFIGURE禁用了备份优化。这意味着,这个命令备份的恢复文件是那些没有备份的文件。可以使用FORCE选项强制所有的文件备份。

不能为这些命令指定DEVICE TYPE DISK。

注意:RMAN仅备份数据库文件:数据文件,控制文件,SPFILES,归档日志文件,以及这些文件的备份。将操作系统文件放置在快速恢复区中,使其被包含在恢复区的备份中。


19、管理备份:报表

clipboard[23]

使用下面的命令获取备份信息:

  • LIST:列出备份集,代理拷贝和镜像拷贝信息
  • REPORT:对备份信息进行分析报告
  • REPORT NEED BACKUP:列出所有需要备份的数据文件
  • REPORT OBSOLETE:列出不再满足当前备份保留策略的文件,可以使用REDUNDANCY或者RECOVERY WINDOW选项指定不同的保留策略来产生报告

RMAN> list backup;

using target database control file instead of recovery catalog

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

76      Full    5.78M      DISK        00:00:01     12-JAN-16     

        BP Key: 87   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T223031

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp

  List of Datafiles in backup set 76

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  4       Full 3659048    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

77      Full    9.52M      DISK        00:00:01     12-JAN-16     

        BP Key: 88   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T223033

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900973833_c9b3j9vn_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3659113      Ckp time: 12-JAN-16

RMAN> report need backup;

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Report of files with less than 1 redundant backups

File #bkps Name

---- ----- -----------------------------------------------------

1    0     /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

2    0     /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

3    0     /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

5    0     /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

7    0     /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

RMAN> backup database;

Starting backup at 13-JAN-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=74 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=00002 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

input datafile file number=00001 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 13-JAN-16

channel ORA_DISK_1: finished piece 1 at 13-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T083100_c9c6p4hq_.bkp tag=TAG20160113T083100 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:35

Finished backup at 13-JAN-16

Starting Control File and SPFILE Autobackup at 13-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_13/o1_mf_s_901010015_c9c6tzoy_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 13-JAN-16

RMAN> report need backup;

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Report of files with less than 1 redundant backups

File #bkps Name

---- ----- -----------------------------------------------------

RMAN> report obsolete;

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Report of obsolete backups and copies

Type                 Key    Completion Time    Filename/Handle

-------------------- ------ ------------------ --------------------

Backup Set           76     12-JAN-16        

  Backup Piece       87     12-JAN-16          /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp

Backup Set           77     12-JAN-16        

  Backup Piece       88     12-JAN-16          /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900973833_c9b3j9vn_.bkp


20、管理备份:动态性能视图

clipboard[24]

可以在目标数据库中查询以下动态性能视图获取备份信息,也可以在恢复目录数据库的恢复目录模式中使用对应的RC_替换V$的这些视图进行查询。

V$BACKUP_SET:创建的备份集

V$BACKUP_PIECE:存在的备份片

V$DATAFILE_COPY:磁盘上面的镜像拷贝

V$BACKUP_FILES:所有备份文件的信息

SQL> select backup_type,file_type,status,fname from v$backup_files;

BACKUP_TYP FILE_TYPE    STATUS     FNAME

---------- ------------ ---------- --------------------------------------------------------------------------------------------------------------

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

BACKUP SET PIECE        AVAILABLE  /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp

BACKUP SET SPFILE

BACKUP SET CONTROLFILE

BACKUP SET PIECE        AVAILABLE  /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900973833_c9b3j9vn_.bkp

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

BACKUP_TYP FILE_TYPE    STATUS     FNAME

---------- ------------ ---------- --------------------------------------------------------------------------------------------------------------

BACKUP SET PIECE        AVAILABLE  /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T083100_c9c6p4hq_.bkp

BACKUP SET SPFILE

BACKUP SET CONTROLFILE

BACKUP SET PIECE        AVAILABLE  /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_13/o1_mf_s_901010015_c9c6tzoy_.bkp

15 rows selected.

[oracle@oracletest ~]$ rman target / catalog rcowner/rcowner

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jan 13 08:51:59 2016

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

connected to target database: STONE (DBID=3001485737)

connected to recovery catalog database

RMAN> resync catalog;

starting full resync of recovery catalog

full resync complete

SQL> conn rcowner/rcowner

Connected.

SQL> call dbms_rcvman.setdatabase(null,null,null,3001485737);

Call completed.

SQL> select backup_type,file_type,status,fname from rc_backup_files;

BACKUP_TYP FILE_TYPE    STATUS     FNAME

---------- ------------ ---------- --------------------------------------------------------------------------------------------------------------

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

BACKUP SET PIECE        AVAILABLE  /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp

BACKUP SET SPFILE

BACKUP SET CONTROLFILE

BACKUP SET PIECE        AVAILABLE  /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900973833_c9b3j9vn_.bkp

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BACKUP SET DATAFILE                /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

BACKUP_TYP FILE_TYPE    STATUS     FNAME

---------- ------------ ---------- --------------------------------------------------------------------------------------------------------------

BACKUP SET PIECE        AVAILABLE  /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T083100_c9c6p4hq_.bkp

BACKUP SET SPFILE

BACKUP SET CONTROLFILE

BACKUP SET PIECE        AVAILABLE  /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_13/o1_mf_s_901010015_c9c6tzoy_.bkp

15 rows selected.


21、使用EM查看备份报告

clipboard[25]

clipboard[26]

clipboard[27]

clipboard[28]


22、管理备份:交叉检查和删除

clipboard[29]

使用下面的命令管理备份:

  • CROSSCHECK:将rman仓库中的备份信息与介质上的文件进行比较,如果对应的文件不存在了,就将该备份信息标记为EXPIRED
  • DELETE EXPIRED:删除标记为EXPIRED的备份信息
  • DELETE OBSOLETE:根据备份策略,删除不再需要的备份,可以使用REDUNDANCY和RECOVERY WINDOW选项

如果没有使用RMAN删除备份,可以使用UNCATALOG命令从恢复目录中删除备份信息,或者使用CROSSCHECK和DELETE EXPIRED命令。

例子:使用CROSSCHECK和DELETE EXPIRED命令

RMAN> list backup;

using target database control file instead of recovery catalog

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

76      Full    5.78M      DISK        00:00:01     12-JAN-16     

        BP Key: 87   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T223031

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp

  List of Datafiles in backup set 76

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  4       Full 3659048    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

77      Full    9.52M      DISK        00:00:01     12-JAN-16     

        BP Key: 88   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T223033

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900973833_c9b3j9vn_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3659113      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

78      Full    1.45G      DISK        00:02:30     13-JAN-16     

        BP Key: 89   Status: AVAILABLE  Compressed: NO  Tag: TAG20160113T083100

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T083100_c9c6p4hq_.bkp

  List of Datafiles in backup set 78

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5       Full 3618687    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

79      Full    9.52M      DISK        00:00:00     13-JAN-16     

        BP Key: 90   Status: AVAILABLE  Compressed: NO  Tag: TAG20160113T083335

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_13/o1_mf_s_901010015_c9c6tzoy_.bkp

  SPFILE Included: Modification time: 13-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3661883      Ckp time: 13-JAN-16

[oracle@oracletest ~]$ rm /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp

RMAN> crosscheck backup;

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=41 device type=DISK

crosschecked backup piece: found to be 'EXPIRED'

backup piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp RECID=87 STAMP=900973831

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900973833_c9b3j9vn_.bkp RECID=88 STAMP=900973833

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T083100_c9c6p4hq_.bkp RECID=89 STAMP=901009860

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_13/o1_mf_s_901010015_c9c6tzoy_.bkp RECID=90 STAMP=901010015

Crosschecked 4 objects

RMAN> delete expired backup;

using channel ORA_DISK_1

List of Backup Pieces

BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name

------- ------- --- --- ----------- ----------- ----------

87      76      1   1   EXPIRED     DISK        /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp

Do you really want to delete the above objects (enter YES or NO)? yes

deleted backup piece

backup piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_12/o1_mf_nnndf_TAG20160112T223031_c9b3j7z6_.bkp RECID=87 STAMP=900973831

Deleted 1 EXPIRED objects

例子:使用UNCATALOG

RMAN> backup datafile 4;

Starting backup at 13-JAN-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00004 name=/u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

channel ORA_DISK_1: starting piece 1 at 13-JAN-16

channel ORA_DISK_1: finished piece 1 at 13-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T095836_c9cctdn4_.bkp tag=TAG20160113T095836 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 13-JAN-16

Starting Control File and SPFILE Autobackup at 13-JAN-16

piece handle=/u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_13/o1_mf_s_901015117_c9cctfrz_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 13-JAN-16

[oracle@oracletest ~]$ rman target / catalog rcowner/rcowner

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jan 13 09:57:48 2016

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

connected to target database: STONE (DBID=3001485737)

connected to recovery catalog database

[oracle@oracletest ~]$ rm /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T095836_c9cctdn4_.bkp

RMAN> list backup;

List of Backup Sets

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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

2643    Full    9.52M      DISK        00:00:01     12-JAN-16     

        BP Key: 2645   Status: AVAILABLE  Compressed: NO  Tag: TAG20160112T223033

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_12/o1_mf_s_900973833_c9b3j9vn_.bkp

  SPFILE Included: Modification time: 12-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3659113      Ckp time: 12-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

3022    Full    1.45G      DISK        00:02:30     13-JAN-16     

        BP Key: 3026   Status: AVAILABLE  Compressed: NO  Tag: TAG20160113T083100

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T083100_c9c6p4hq_.bkp

  List of Datafiles in backup set 3022

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  1       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_system_c06xczt5_.dbf

  2       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_sysaux_c06xczw8_.dbf

  3       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_undotbs1_c06xczwc_.dbf

  4       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

  5       Full 3618687    12-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_example_c06xj0bk_.dbf

  7       Full 3661683    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_rcat_ts_c8vd4mmy_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

3023    Full    9.52M      DISK        00:00:00     13-JAN-16     

        BP Key: 3027   Status: AVAILABLE  Compressed: NO  Tag: TAG20160113T083335

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_13/o1_mf_s_901010015_c9c6tzoy_.bkp

  SPFILE Included: Modification time: 13-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3661883      Ckp time: 13-JAN-16

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

3100    Full    5.78M      DISK        00:00:00     13-JAN-16     

        BP Key: 3104   Status: AVAILABLE  Compressed: NO  Tag: TAG20160113T095836

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T095836_c9cctdn4_.bkp

  List of Datafiles in backup set 3100

  File LV Type Ckp SCN    Ckp Time  Name

  ---- -- ---- ---------- --------- ----

  4       Full 3667290    13-JAN-16 /u01/app/oracle/oradata/STONE/datafile/o1_mf_users_c06xczx2_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

3101    Full    9.52M      DISK        00:00:00     13-JAN-16     

        BP Key: 3105   Status: AVAILABLE  Compressed: NO  Tag: TAG20160113T095837

        Piece Name: /u01/app/oracle/fast_recovery_area/STONE/autobackup/2016_01_13/o1_mf_s_901015117_c9cctfrz_.bkp

  SPFILE Included: Modification time: 13-JAN-16

  SPFILE db_unique_name: STONE

  Control File Included: Ckp SCN: 3667297      Ckp time: 13-JAN-16

RMAN> change backuppiece 3104  uncatalog;

uncataloged backup piece

backup piece handle=/u01/app/oracle/fast_recovery_area/STONE/backupset/2016_01_13/o1_mf_nnndf_TAG20160113T095836_c9cctdn4_.bkp RECID=91 STAMP=901015116

Uncataloged 1 objects


22、相关习题

(1)Examine the following RMAN command:

BACKUP DATABASE 

TAG TESTDB

KEEP UNTIL 'SYSDATE+1'

RESTORE POINT TESTDB06;

Which two statements are true regarding the backup taken by using the above RMAN command? (Choose two.)

A.

Only data files and the control file are backed up.

B.

Archived redo logs are backed up only if the database is open during the backup.

C.

The backup is deleted after one day, regardless of the default retention policy settings.

D.

The backup becomes obsolete after one day, regardless of the default retention policy settings.

答案:BD

(2)You want to use RMAN to create compressed backups.

Which statement is true about the compression algorithms that RMAN can use?

A.

The BZIP2 compression algorithm consumes more CPU resources than the ZLIB compression algorithm.

B.

The ZLIB compression algorithm consumes more CPU resources than the BZIP2 compression algorithm.

C.

The ZLIB compression algorithm provides maximum compression and produces smaller backups than the BZIP2 compression algorithm.

D.

Only the BZIP2 compression algorithm can be used to make compressed backups to disk.

答案:A

(3)You have not configured Oracle Managed Files (OMF) in your database. You do not want to scan the entire datafile every time an incremental backup is performed. You decide to enable the block change tracking feature. Which statement should you use to enable the block change tracking feature?

A.

ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;

B.

ALTER SYSTEM ENABLE BLOCK CHANGE TRACKING USING FILE ;

C.

ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE ;

D.

ALTER SYSTEM ENABLE BLOCK CHANGE TRACKING;

答案:C

(4)You are using Recovery Manager (RMAN) to perform backups. In which three situations would you perform a compressed backup? (Choose three.)

A.

You are backing up to tape and your tape device performs its own compression.

B.

You are making image copies, and you have not enabled tablespace compression.

C.

You are using disk-based backups and disk space in your Flash Recovery Area, or other disk-based backup destinations are limited.

D.

You are performing your backups to some device over a network where reduced network bandwidth is more important than CPU usage.

E.

You are using some archival backup media, such as CD or DVD, where reducing backup sizes saves media costs and archival storage.

答案:CDE

(5)You enable block change tracking. You issue the following command:

BACKUP INCREMENTAL LEVEL 0 DATABASE;

The next day, you issue the following command:

BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;

Which statement about the use of the change tracking file is true?

A.

RMAN reads the block change tracking file only when it performs the incremental level 0 backup.

B.

RMAN reads the block change tracking file when it performs both incremental backups.

C.

RMAN reads the block change tracking file only when it performs the incremental level 1 backup.

D.

RMAN does not read the block change tracking file when it performs either incremental backup.

答案:C

(6)While performing the backup of the flash recovery area, you notice that one of the archived redo log files is missing. You have multiple destinations for archived redo log files. What implications does it have on the backup of the flash recovery area?

A.  The backup fails because one of the archived redo log files is missing.

B.  The backup succeeds but it would be without the missing archived log.

C.  During backup, you are prompted for the alternative destination for the missing archived redo log file.

D.  The backup succeeds because it fails over to one of the alternative archived redo log destinations.

答案:D

(7)A shoot-out has erupted between your MS development teams using .NET and your Linux development teams using Java. Knowing that your database is in danger, which command would you use to back up your NOARCHIVELOG mode database using RMAN with compression?

A.  backup database all

B.  backup compressed database

C.  backup as compressed backupset database;

D.  backup as compressed backup database plus archivelog all;

E.  backup as compressed backupset database plus compress archivelog all;

答案:C

(8)You issued the following RMAN command to back up the database:

RMAN> RUN{

ALLOCATE CHANNEL c1 DEVICE TYPE sbt

BACKUP DATABASE

TAG quarterly

KEEP FOREVER

RESTORE POINT FY06Q4;}

Which two statements are true regarding the backup performed? (Choose two.)

A.  Archived redo log files are backed up along with data files.

B.  Only data files are backed up and a restore point named FY06Q4 is created.

C.  Archived log files are backed up along with data files, and the archived log files are deleted.

D.  The command creates a restore point named FY06Q4 to match the SCN at which this backup is consistent.

答案:AD

(9)When performing an online backup, what is the proper order of the following steps?

a.  Issue the alter database end backup command.

b.  Back up the archived redo logs.

c.  Issue the alter database begin backup command.

d.  Back up the database files.

e.  Determine the beginning log sequence number.

f.  Determine the ending log sequence number.

g.  Force a log switch with the alter system switch logfile command.

A.  a, b, c, d, e, f, g

B.  c, d, a, b, e, g, f

C.  f, d, b, g, a, c, e

D.  e, c, d, a, g, f, b

E.  a, f, b, g, e, c, d

答案:D

(10)You want to put a specific tablespace called MY_DATA in hot backup mode so you can back it up.

What command would you use?

A.  alter tablespace MY_DATA begin backup;

B.  alter tablespace MY_DATA start backup;

C.  alter tablespace MY_DATA backup begin;

D.  alter MY_DATA begin backup;

E.  You cannot back up individual tablespaces.

答案:A

(11)You backed up the database at 8 a.m. today using an online backup. Accounting made a large change to the underlying data between 10 a.m. and noon. Which of the following actions would ensure that the changes could be recovered using the 8 a.m. backup?

A.  Create a manual incremental online database backup.

B.  Back up all the archived redo logs generated since the 8 a.m. backup.

C.  Create a brand-new backup after all the changes have been applied.

D.  There is no way to make the changes recoverable based on the 8 a.m. backup.

E.  Perform an online backup of the tablespace(s) that contained changed data.

答案:B

(12)What are the different logging modes available in Oracle Database 11g? (Choose two.)

A.  NOLOG mode

B.  NOARCHIVELOG mode

C.  LOGGING mode

D.  HOTDATABASE mode

E.  ARCHIVELOG mode

答案:BE

(13)Which is the correct command to put the database in ARCHIVELOG mode?

A.  alter database archivelog

B.  alter system enable archivelog mode

C.  alter database enable archive

D.  alter database archivelog enable

E.  None of the above

答案:A

(14)What is the correct order of steps to perform an online database backup?

a.  alter database begin backup;

b.  alter database end backup;

c.  Back up the database datafiles.

d.  Back up the archive log files.

e.  alter system switch logfile;

A.  a, b, c, d, e

B.  e, d, a, b, c

C.  a, c, b, d, e

D.  d, b, c, a, e

E.  a, c, b, e, d

答案:E

(15)Which command will result in a trace file being created with the create controlfile command contained in it?

A.  alter database backup controlfile;

B.  alter database backup controlfile to trace;

C.  alter database controlfile backup;

D.  alter database controlfile backup to '/ora01/oracle/ctrl_backup.ctl';

E.  alter database begin controlfile backup;

答案:B

(16)Which of the following is a valid way of putting a tablespace named DAVE_TBS into hot backup mode?

A.  alter tablespace DAVE_TBS backup mode;

B.  alter tablespace DAVE_TBS start backup;

C.  alter tablespace DAVE_TBS begin backup;

D.  alter tablespace DAVE_TBS backup begin;

E.  alter tablespace DAVE_TBS backup;

答案:C

(17)Every Sunday the Unix system administrator has a job that executes a full backup of the entire Unix system your database is on. Is this backup usable for backup and recovery of your database?

A.  Yes, if the database is in ARCHIVELOG mode.

B.  Yes, if the database is in NOARCHIVELOG mode.

C.  No, the backup is not usable in any way.

D.  Only if the ENABLE_ONLINE_BACKUP parameter is set to TRUE.

答案:C

(18)Which is not a valid way of backing up a control file?

A.  Backing up the control file to trace

B.  Copying the existing control file of the database to the backup location during a hot backup

C.  Copying the existing control file of the database to the backup location during a cold backup

D.  Creating a backup control file

E.  Using the create controlfile command

答案:B

(19)Which view provides information on the backup status of the datafiles in the database?

A.  V$BACKUP

B.  V$BACKUP_STATUS

C.  V$BACKUP_DATAFILE

D.  V$DATAFILE_BACKUP

E.  V$TABLESPCE_BACKUP

答案:A

(20)Another DBA issues a shutdown abort command on a database on which you were running an online backup. What will happen when you try to restart the database?

A.  Oracle will automatically take the datafile out of hot backup mode, generate a warning message, and then open the database.

B.  Oracle will automatically take the datafile out of hot backup mode and then open the database.

C.  Oracle will generate an error when trying to open the database, indicating that a datafile is in hot backup mode.You will need to correct this error before you can open the database.

D.  The database will open with the file in hot backup mode. You can restart the backup at any time.

E.  The datafile in hot backup mode will be corrupted and you will have to recover it.

答案:C

(21)What is the proper command to shut down the database in a consistent manner?

A.  Shutdown abort

B.  Shutdown kill

C.  Shutdown nowait

D.  shutdown immediate

E.  shutdown halt

答案:D

(22)Which is the correct command to back up the database, back up the archived redo logs, and then remove the backed-up archived redo logs?

A.  backup database

B.  backup database and archivelogs

C.  backup database plus archivelogs

D.  backup database plus archivelog delete input

E.  backup database and archivelog delete input

答案:D

(23)Which of the following best describes a full backup?

A.  All datafiles of a database

B.  All datafiles, archive logs, and control files

C.  All datafiles and control files

D.  All the used blocks in a datafile

答案:D

(24)Which type of backup backs up only data blocks modified since the most recent backup at the same level or lower?

A.  Differential incremental backup

B.  Different incremental backup

C.  Cumulative backup

D.  Cumulative incremental backup

答案:A

(25)Which type of backup must be performed first with an incremental backup?

A.  Level 1

B.  Level 0

C.  Level 2

D.  Level 3

答案:B

(26)Which backup option defines a user-defined name for a backup?

A.  FORMAT

B.  NAME

C.  TAG

D.  FORMAT U%

答案:C

(27)Given the following steps, which would be the correct order to create a backup of an Oracle database in NOARCHIVELOG mode?

a.  shutdown immediate from RMAN

b.  Log into RMAN

c.  startup mount from RMAN

d.  backup database

e.  alter database open

f.  backup database plus archivelog delete input

A.  b, c, a, d, e

B.  b, a, c, f, e

C.  a, c, e, d

D.  b, a, c, e, f

E.  b, a, c, d, e

答案:E

(28)Which of the following most closely represents an image copy?

A.  Unix cp command of a file

B.  Bit-by-bit copy of a file

C.  Windows COPY command of a file

D.  All of the above

答案:D

(29)Given the following steps, which would be the correct order to create a backup of an Oracle database in ARCHIVELOG mode with control-file autobackups enabled?

a.  backup archivelog all;

b.  backup database all;

c.  backup controlfile;

d.  backup archivelog, database, controlfile delete input;

e.  backup database plus archivelog delete input

A.  e

B.  a, b, a, c

C.  d

D.  b, a, c

E.  b, a, c, d, e

答案:A

(30)Which of the following statements are true about the BACKUP command? (Choose all that apply.)

A.  The BACKUP command can not be used to make image copies of a datafile.

B.  The BACKUP command can improve performance by multiplexing backup files.

C.  The BACKUP can take advantage of the block-change tracking capability.

D.  The BACKUP command cannot store data in incremental backups.

E.  The BACKUP command can store data in cumulative incremental backups only.

答案:BC

(31)Which command creates an image copy?

A.  backup as copy

B.  backup copy

C.  copy as backup

D.  copy back

答案:A

(32)View the Exhibit and examine the RMAN commands.

Which statement describes the effect of a backup retention policy on the backup of a backup set?

png此主题相关图片如下:
clipboard[30]

A.Either all the copies of a backup set are obsolete or none of them are as per the retention policy.

B.The copies of the backup will be reported as obsolete under a redundancy-based backup retention policy.

C.The copies of the backup will be reported as obsolete under a recovery window-based backup retention policy.

D.All the copies of the backup set are counted as one instance of a backup and will deleted in backup set exceeds the redundancy-based backup retention policy.

答案:D

(33)Examine the following command for RMAN backup:

Which statement is true regarding the approach in the command?

此主题相关图片如下:
clipboard[31]

A.The RMAN multiplexing level is 4.

B.It is the use of asynchronous I/O by RMAN.

C.It is a case of parallelization of the backup set.

D.It is an implementation of a multisection backup.

答案:C

请使用浏览器的分享功能分享到微信等