Chinaunix首页 | 论坛 | 博客
  • 博客访问: 28896
  • 博文数量: 8
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-27 08:51
文章分类
文章存档

2014年(8)

我的朋友

分类: Oracle

2014-06-06 16:19:12

  

概要:

  1. 全库备份(非增量
  2. 备份控制文件
  3. 备份归档日志:
  4. 备份SPFILE(PFILE)
  5. 备份集的备份
  6. DELETE INPUT参数的使用
  7. 增量备份简述
  8. 差异增量备份操作
  9. 累积增量备份操作
  10. 备份的删除
  11. 备份集容量限制


 


全库备份(非增量 :

注:飞增量备份指的是一次成型,不能再追加变化部分的备份。


RMAN> backup database;

 

Starting backup at 02-AUG-13

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=10 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00001 name=/oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

input datafile file number=00002 name=/oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

input datafile file number=00005 name=/oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

input datafile file number=00003 name=/oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

input datafile file number=00004 name=/oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/05og8fns_1_1 tag=TAG20130802T015052 comment=NONE

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

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

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/06og8fsf_1_1 tag=TAG20130802T015052 comment=NONE

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

Finished backup at 02-AUG-13



查看备份集:

RMAN> list backupset;

 

 

List of Backup Sets

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

 

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

1       Full    9.36M      DISK        00:00:03     02-AUG-13     

        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20130802T014453

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/02og8fcm_1_1

  SPFILE Included: Modification time: 02-AUG-13

  SPFILE db_unique_name: ORCL

  Control File Included: Ckp SCN: 1181185      Ckp time: 02-AUG-13

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

2       Full    9.36M      DISK        00:00:01     02-AUG-13        ---------------备份为全库备份,增量备份的话,Key的值为 "Incr" ,“Incr”的级别一般显示为"O"或"1"

        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20130802T014548

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/04og8fed_1_1

  SPFILE Included: Modification time: 02-AUG-13

  SPFILE db_unique_name: ORCL

  Control File Included: Ckp SCN: 1181217      Ckp time: 02-AUG-13

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

3       Full    1.01G      DISK        00:02:24     02-AUG-13     

        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20130802T015052

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/05og8fns_1_1

  List of Datafiles in backup set 3

  File LV Type Ckp SCN    Ckp Time  Name

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

  1       Full 1181392    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

  2       Full 1181392    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

  3       Full 1181392    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

  4       Full 1181392    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

  5       Full 1181392    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

4       Full    9.36M      DISK        00:00:04     02-AUG-13     

        BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20130802T015052

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/06og8fsf_1_1

  SPFILE Included: Modification time: 02-AUG-13

  SPFILE db_unique_name: ORCL

  Control File Included: Ckp SCN: 1181392      Ckp time: 02-AUG-13

                          -----------------------------------多读一下反馈信息,可能字数不多的几句话会包含重要信息。控制文件默认应该是不备份的,具体情况要看软件版本和用户设置,如果想确定配置是否为自动备份控制文件,执行 show all ,看看"CONFIGURE CONTROLFILE AUTOBACKUP"的值为"on"还是"off"即可,On为自动备份,Off为不备份。


讲到这里,不得不说一下控制文件的备份。

备份数据库的时候一起备份控制文件:

  控制文件非常重要,在非catalog备份的情况下,备份信息会保存在控制文件中,所以控制文件的备份很有必要,否则恢复起来有一定难度,不过即使控制文件丢失,网上也可以搜索到很多恢复方法。

控制文件的备份方式大概有两种:(当然你也可以单独一条命令备份控制文件,不过建议还是跟数据文件和归档文件一同备份)

1.备份时指定 inclue current controlfile;

2.设置autobackup contolfile。

RMAN> backup database include current controlfile;

 

Starting backup at 02-AUG-13

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=00001 name=/oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

input datafile file number=00002 name=/oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

input datafile file number=00005 name=/oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

input datafile file number=00003 name=/oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

input datafile file number=00004 name=/oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0dog8hju_1_1 tag=TAG20130802T022254 comment=NONE

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

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

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0eog8hma_1_1 tag=TAG20130802T022254 comment=NONE

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

Finished backup at 02-AUG-13



注:查看已备份的控制文件以及查看已备份的数据文件、备份集等等,请参照:RMAN备份、恢复实验室 之 备份篇 【查看备份情况】 



备份归档日志:



 备份归档日志的方法一般有两种:
 

1.直接备份

RMAN> backup archivelog all;

 

Starting backup at 02-AUG-13

current log archived

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=9 device type=DISK

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=12 RECID=1 STAMP=822365504

input archived log thread=1 sequence=13 RECID=2 STAMP=822365512

input archived log thread=1 sequence=14 RECID=3 STAMP=822365514

input archived log thread=1 sequence=15 RECID=4 STAMP=822365514

input archived log thread=1 sequence=16 RECID=6 STAMP=822365518

input archived log thread=1 sequence=17 RECID=5 STAMP=822365518

input archived log thread=1 sequence=18 RECID=7 STAMP=822365518

input archived log thread=1 sequence=19 RECID=8 STAMP=822365518

input archived log thread=1 sequence=20 RECID=9 STAMP=822365521

input archived log thread=1 sequence=21 RECID=10 STAMP=822365533

input archived log thread=1 sequence=22 RECID=11 STAMP=822365547

input archived log thread=1 sequence=23 RECID=12 STAMP=822365601

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0hog8jd2_1_1 tag=TAG20130802T025322 comment=NONE

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

Finished backup at 02-AUG-13

 

Starting Control File and SPFILE Autobackup at 02-AUG-13      -------------------这里的autobackup controlfile仍然生效。

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/c-1347976258-20130802-01 comment=NONE

Finished Control File and SPFILE Autobackup at 02-AUG-13


2.随其他文件一起备份:




RMAN> backup current controlfile  plus archivelog;     --------------------------关键字:“plus archivelog”,尽情发挥吧,多动手尝试一下备份其他东西的时候加入这个关键字。




Starting backup at 02-AUG-13
current log archived                                    -------执行备份archivelog的时候不需要再执行  “ALTER SYSTEM ARCHIVE LOG CURRENT;”  对日志进行归档。备份过程中会在开始和之后分                                                                               别执行一次  “ALTER SYSTEM ARCHIVE LOG CURRENT;”  也就是说总共执行两次。
using channel ORA_DISK_1
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=12 RECID=1 STAMP=822365504
input archived log thread=1 sequence=13 RECID=2 STAMP=822365512
input archived log thread=1 sequence=14 RECID=3 STAMP=822365514
input archived log thread=1 sequence=15 RECID=4 STAMP=822365514
input archived log thread=1 sequence=16 RECID=6 STAMP=822365518
input archived log thread=1 sequence=17 RECID=5 STAMP=822365518
input archived log thread=1 sequence=18 RECID=7 STAMP=822365518
input archived log thread=1 sequence=19 RECID=8 STAMP=822365518
input archived log thread=1 sequence=20 RECID=9 STAMP=822365521
input archived log thread=1 sequence=21 RECID=10 STAMP=822365533
input archived log thread=1 sequence=22 RECID=11 STAMP=822365547
input archived log thread=1 sequence=23 RECID=12 STAMP=822365601
input archived log thread=1 sequence=24 RECID=13 STAMP=822366550
channel ORA_DISK_1: starting piece 1 at 02-AUG-13
channel ORA_DISK_1: finished piece 1 at 02-AUG-13
piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0jog8kam_1_1 tag=TAG20130802T030910 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-AUG-13


Starting backup at 02-AUG-13
using channel ORA_DISK_1
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 02-AUG-13
channel ORA_DISK_1: finished piece 1 at 02-AUG-13
piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0kog8kan_1_1 tag=TAG20130802T030911 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-AUG-13


Starting backup at 02-AUG-13
current log archived    
                                       ------------------------第二次执行  “ALTER SYSTEM ARCHIVE LOG CURRENT;”
using channel ORA_DISK_1
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=25 RECID=14 STAMP=822366553
channel ORA_DISK_1: starting piece 1 at 02-AUG-13
channel ORA_DISK_1: finished piece 1 at 02-AUG-13
piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0log8kap_1_1 tag=TAG20130802T030913 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-AUG-13



备份SPFILE(PFILE):

注:实际上备份哪个都可以,事后用create from互相转换即可。一般也会随着其他文件自动备份。


RMAN> backup spfile;

 

Starting backup at 02-AUG-13

using channel ORA_DISK_1

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 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0mog8kbd_1_1 tag=TAG20130802T030933 comment=NONE

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

Finished backup at 02-AUG-13



备份集的备份:

RMAN> backup backupset all;

 

Starting backup at 02-AUG-13

using channel ORA_DISK_1

channel ORA_DISK_1: input backup set: count=2, stamp=822361494, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/02og8fcm_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/02og8fcm_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=4, stamp=822361549, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/04og8fed_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/04og8fed_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=5, stamp=822361852, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/05og8fns_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/05og8fns_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=6, stamp=822361999, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/06og8fsf_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/06og8fsf_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=9, stamp=822363197, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/09og8h1t_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/09og8h1t_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=11, stamp=822363569, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0bog8hdh_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0bog8hdh_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=12, stamp=822363747, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0cog8hj3_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0cog8hj3_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=13, stamp=822363774, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0dog8hju_1_1 

                                                                                                      ----注意命名变化和命名规则。后者是备份集的备份。

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0dog8hju_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=14, stamp=822363850, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0eog8hma_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0eog8hma_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=16, stamp=822365009, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

skipping backup piece handle /oracle/app/oracle/product/11.2.0/db_1/dbs/c-1347976258-20130802-00; already exists

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=17, stamp=822365602, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0hog8jd2_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0hog8jd2_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=18, stamp=822365603, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

skipping backup piece handle /oracle/app/oracle/product/11.2.0/db_1/dbs/c-1347976258-20130802-01; already exists

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=19, stamp=822366550, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0jog8kam_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0jog8kam_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=20, stamp=822366551, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0kog8kan_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0kog8kan_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=21, stamp=822366553, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0log8kap_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0log8kap_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

channel ORA_DISK_1: input backup set: count=22, stamp=822366573, piece=1

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: backup piece /oracle/app/oracle/product/11.2.0/db_1/dbs/0mog8kbd_1_1

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0mog8kbd_1_2 comment=NONE

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

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

Finished backup at 02-AUG-13




DELETE INPUT参数的使用:

可以用于在备份完归档日志后,删除已备份的归档日志。


[oracle@dbserver oracle]$ cd app/oracle/product/11.2.0/db_1/

[oracle@dbserver db_1]$ cd dbs/

[oracle@dbserver dbs]$ ls        ---------------查看归档日志所在目录

0dog8hju_1_1  0kog8kan_1_2            arch1_14_820195525.dbf  arch1_21_820195525.dbf  init.ora

0dog8hju_1_2  0log8kap_1_1            arch1_15_820195525.dbf  arch1_22_820195525.dbf  lkORCL

0hog8jd2_1_1  0log8kap_1_2            arch1_16_820195525.dbf  arch1_23_820195525.dbf  orapworcl

0hog8jd2_1_2  0mog8kbd_1_1            arch1_17_820195525.dbf  arch1_24_820195525.dbf  snapcf_orcl.f

0jog8kam_1_1  0mog8kbd_1_2            arch1_18_820195525.dbf  arch1_25_820195525.dbf  spfileorcl.ora

0jog8kam_1_2  arch1_12_820195525.dbf  arch1_19_820195525.dbf  hc_DBUA0.dat

0kog8kan_1_1  arch1_13_820195525.dbf  arch1_20_820195525.dbf  hc_orcl.dat

[oracle@dbserver dbs]$ ls |wc –l   ----------统计该目录下有几个文件,如果参数生效,文件数会降低。

33                                             ----------在执行添加“DELETE INPUT”命令之前的归档路径下的文件数。该目录下还包含其他文件,我们根据执行命令后文件的变化量和文件名判断是否能真                                                              正删除archivelog




[oracle@dbserver dbs]$ rman target /

 

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Aug 2 03:20:40 2013

 

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

 

connected to target database: ORCL (DBID=1347976258)

 

RMAN> backup archivelog all delete input;         ------------delete input参数的使用

 

Starting backup at 02-AUG-13

current log archived

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=136 device type=DISK

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=12 RECID=1 STAMP=822365504

input archived log thread=1 sequence=13 RECID=2 STAMP=822365512

input archived log thread=1 sequence=14 RECID=3 STAMP=822365514

input archived log thread=1 sequence=15 RECID=4 STAMP=822365514

input archived log thread=1 sequence=16 RECID=6 STAMP=822365518

input archived log thread=1 sequence=17 RECID=5 STAMP=822365518

input archived log thread=1 sequence=18 RECID=7 STAMP=822365518

input archived log thread=1 sequence=19 RECID=8 STAMP=822365518

input archived log thread=1 sequence=20 RECID=9 STAMP=822365521

input archived log thread=1 sequence=21 RECID=10 STAMP=822365533

input archived log thread=1 sequence=22 RECID=11 STAMP=822365547

input archived log thread=1 sequence=23 RECID=12 STAMP=822365601

input archived log thread=1 sequence=24 RECID=13 STAMP=822366550

input archived log thread=1 sequence=25 RECID=14 STAMP=822366553

input archived log thread=1 sequence=26 RECID=15 STAMP=822367251

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0nog8l0k_1_1 tag=TAG20130802T032052 comment=NONE

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

channel ORA_DISK_1: deleting archived log(s)                            ---------------删除archive logs

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_12_820195525.dbf RECID=1 STAMP=822365504

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_13_820195525.dbf RECID=2 STAMP=822365512

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_14_820195525.dbf RECID=3 STAMP=822365514

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_15_820195525.dbf RECID=4 STAMP=822365514

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_16_820195525.dbf RECID=6 STAMP=822365518

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_17_820195525.dbf RECID=5 STAMP=822365518

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_18_820195525.dbf RECID=7 STAMP=822365518

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_19_820195525.dbf RECID=8 STAMP=822365518

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_20_820195525.dbf RECID=9 STAMP=822365521

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_21_820195525.dbf RECID=10 STAMP=822365533

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_22_820195525.dbf RECID=11 STAMP=822365547

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_23_820195525.dbf RECID=12 STAMP=822365601

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_24_820195525.dbf RECID=13 STAMP=822366550

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_25_820195525.dbf RECID=14 STAMP=822366553

archived log file name=/oracle/app/oracle/product/11.2.0/db_1/dbs/arch1_26_820195525.dbf RECID=15 STAMP=822367251

Finished backup at 02-AUG-13

 

RMAN> exit

 

 

Recovery Manager complete.

再去刚才的目录下看看归档日志的数量:


[oracle@dbserver dbs]$ cd /oracle/app/oracle/product/11.2.0/db_1/dbs/

[oracle@dbserver dbs]$ ls         ---------会发现归档日志全被删除

0dog8hju_1_1  0hog8jd2_1_2  0kog8kan_1_1  0log8kap_1_2  0nog8l0k_1_1  init.ora   snapcf_orcl.f

0dog8hju_1_2  0jog8kam_1_1  0kog8kan_1_2  0mog8kbd_1_1  hc_DBUA0.dat  lkORCL     spfileorcl.ora

0hog8jd2_1_1  0jog8kam_1_2  0log8kap_1_1  0mog8kbd_1_2  hc_orcl.dat   orapworcl

[oracle@dbserver dbs]$ ls |wc -l

20    --------------------刚才的文件数是33。所以命令执行没有问题。




增量备份:



 增量备份比之前所讲到的备份的好处在于,可以只备份数据增量(即数据变化、更改的部分)。世间事物都有两面性,虽然增量备份在备份的时候可以节省很多重复的工作和不必要的空间浪费,但是在恢复阶段,增量备份的速度可能会略微有些慢,具体程度要看机器配置、网络速度和增量备份集的大小等因素。


 增量备份一定要有一个最初的全备作为基础,在此基础上做增量备份。当然也可以在 全备+增量备份 的基础上做更进一步的增量。晕了没?

 实际上以上两种增量是两种不同的增量模式。


 增量备份分为两种:差异增量备份和累积增量备份。缺省的增量备份是差异增量备份。


不管哪种增量备份,都是先从0级(全备)开始备份,然后是1、2、3....

下面用图例说明两种备份的不同:

差异增量备份:
 

累积增量备份:



 差异增量操作命令:

RMAN> backup incremental level=0 database;

 

Starting backup at 02-AUG-13

using channel ORA_DISK_1

channel ORA_DISK_1: starting incremental level 0 datafile backup set    -------------提示信息很明确

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00001 name=/oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

input datafile file number=00002 name=/oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

input datafile file number=00005 name=/oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

input datafile file number=00003 name=/oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

input datafile file number=00004 name=/oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0oog8lg6_1_1 tag=TAG20130802T032909 comment=NONE

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

channel ORA_DISK_1: starting incremental level 0 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0pog8lir_1_1 tag=TAG20130802T032909 comment=NONE

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

Finished backup at 02-AUG-13

RMAN> list backup;

 

 

List of Backup Sets

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



BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

22      Incr 0  1.01G      DISK        00:01:23     02-AUG-13                    ---------------------------0级增量备份

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0oog8lg6_1_1

  List of Datafiles in backup set 22

  File LV Type Ckp SCN    Ckp Time  Name

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

  1    0  Incr 1183550    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

  2    0  Incr 1183550    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

  3    0  Incr 1183550    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

  4    0  Incr 1183550    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

  5    0  Incr1183550    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

23      Incr 0  9.36M      DISK        00:00:03     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0pog8lir_1_1

  SPFILE Included: Modification time: 02-AUG-13

  SPFILE db_unique_name: ORCL

  Control File Included: Ckp SCN: 1183581      Ckp time: 02-AUG-13

 

RMAN> 


 


1级增量备份:



对数据库全库进行1级增量备份:


RMAN> backup incremental level=1 database;

 

Starting backup at 02-AUG-13

using channel ORA_DISK_1

channel ORA_DISK_1: starting incremental level 1 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00001 name=/oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

input datafile file number=00002 name=/oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

input datafile file number=00005 name=/oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

input datafile file number=00003 name=/oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

input datafile file number=00004 name=/oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0qog8lm8_1_1 tag=TAG20130802T033224 comment=NONE

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

channel ORA_DISK_1: starting incremental level 1 datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0rog8lnv_1_1 tag=TAG20130802T033224 comment=NONE

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

Finished backup at 02-AUG-13

 

RMAN> list backup;

 

 

List of Backup Sets

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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

24      Incr 1  232.00K    DISK        00:00:54     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0qog8lm8_1_1

  List of Datafiles in backup set 24

  File LV Type Ckp SCN    Ckp Time  Name

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

  1    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

  2    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

  3    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

  4    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

  5    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

25      Incr 1  9.36M      DISK        00:00:03     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0rog8lnv_1_1

  SPFILE Included: Modification time: 02-AUG-13

  SPFILE db_unique_name: ORCL

  Control File Included: Ckp SCN: 1183661      Ckp time: 02-AUG-13

 


BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

24      Incr 1  232.00K    DISK        00:00:54     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0qog8lm8_1_1

  List of Datafiles in backup set 24

  File LV Type Ckp SCN    Ckp Time  Name

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

  1    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

  2    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

  3    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

  4    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

  5    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

25      Incr 1  9.36M      DISK        00:00:03     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0rog8lnv_1_1

  SPFILE Included: Modification time: 02-AUG-13

  SPFILE db_unique_name: ORCL

  Control File Included: Ckp SCN: 1183661      Ckp time: 02-AUG-13

 

数据文件的1级增量备份:

RMAN> backup incremental level=1 datafile 2;

 

Starting backup at 02-AUG-13

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=/oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0sog8m0n_1_1 tag=TAG20130802T033759 comment=NONE

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

Finished backup at 02-AUG-13

 

表空间的1级增量备份:

RMAN> backup incremental level=1 tablespace example;

 

Starting backup at 02-AUG-13

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=00005 name=/oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0tog8m1a_1_1 tag=TAG20130802T033818 comment=NONE

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

Finished backup at 02-AUG-13

 

RMAN> list backup;

 

 

List of Backup Sets

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

 



BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

24      Incr 1  232.00K    DISK        00:00:54     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0qog8lm8_1_1

  List of Datafiles in backup set 24

  File LV Type Ckp SCN    Ckp Time  Name

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

  1    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

  2    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

  3    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

  4    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

  5    1  Incr 1183643    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

25      Incr 1  9.36M      DISK        00:00:03     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0rog8lnv_1_1

  SPFILE Included: Modification time: 02-AUG-13

  SPFILE db_unique_name: ORCL

  Control File Included: Ckp SCN: 1183661      Ckp time: 02-AUG-13

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

26      Incr 1  32.00K     DISK        00:00:02     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0sog8m0n_1_1

  List of Datafiles in backup set 26

  File LV Type Ckp SCN    Ckp Time  Name

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

  2    1  Incr 1183789    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

27      Incr 1  32.00K     DISK        00:00:02     02-AUG-13     

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

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/0tog8m1a_1_1

  List of Datafiles in backup set 27

  File LV Type Ckp SCN    Ckp Time  Name

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

  5    1  Incr 1183805    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf


累积的1级增量数据文件备份:

 

RMAN> backup incremental level=1 cumulative datafile 2;

 

Starting backup at 02-AUG-13

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=/oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0uog8pvi_1_1 tag=TAG20130802T044538 comment=NONE

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

Finished backup at 02-AUG-13

 
累积的1级增量表空间备份:

RMAN> backup incremental level=1 cumulative tablespace example;

 

Starting backup at 02-AUG-13

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=00005 name=/oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0vog8q07_1_1 tag=TAG20130802T044559 comment=NONE

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

Finished backup at 02-AUG-13






备份的删除:

 

RMAN> delete backup;

 

using channel ORA_DISK_1

 

List of Backup Pieces

BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name

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

11      11      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0dog8hju_1_1

28      11      1   2   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0dog8hju_1_2

15      15      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0hog8jd2_1_1

30      15      1   2   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0hog8jd2_1_2

17      17      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0jog8kam_1_1

31      17      1   2   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0jog8kam_1_2

18      18      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0kog8kan_1_1

32      18      1   2   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0kog8kan_1_2

19      19      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0log8kap_1_1

33      19      1   2   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0log8kap_1_2

20      20      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0mog8kbd_1_1

34      20      1   2   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0mog8kbd_1_2

35      21      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0nog8l0k_1_1

36      22      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0oog8lg6_1_1

37      23      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0pog8lir_1_1

38      24      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0qog8lm8_1_1

39      25      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0rog8lnv_1_1

40      26      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0sog8m0n_1_1

41      27      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0tog8m1a_1_1

42      28      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0uog8pvi_1_1

43      29      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/0vog8q07_1_1

44      30      1   1   AVAILABLE   DISK        /oracle/app/oracle/product/11.2.0/db_1/dbs/10og8rop_1_1

 

Do you really want to delete the above objects (enter YES or NO)? yes

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0dog8hju_1_1 RECID=11 STAMP=822363774

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0dog8hju_1_2 RECID=28 STAMP=822366670

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0hog8jd2_1_1 RECID=15 STAMP=822365602

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0hog8jd2_1_2 RECID=30 STAMP=822366748

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0jog8kam_1_1 RECID=17 STAMP=822366550

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0jog8kam_1_2 RECID=31 STAMP=822366749

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0kog8kan_1_1 RECID=18 STAMP=822366552

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0kog8kan_1_2 RECID=32 STAMP=822366750

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0log8kap_1_1 RECID=19 STAMP=822366553

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0log8kap_1_2 RECID=33 STAMP=822366751

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0mog8kbd_1_1 RECID=20 STAMP=822366573

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0mog8kbd_1_2 RECID=34 STAMP=822366752

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0nog8l0k_1_1 RECID=35 STAMP=822367252

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0oog8lg6_1_1 RECID=36 STAMP=822367750

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0pog8lir_1_1 RECID=37 STAMP=822367838

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0qog8lm8_1_1 RECID=38 STAMP=822367944

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0rog8lnv_1_1 RECID=39 STAMP=822368002

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0sog8m0n_1_1 RECID=40 STAMP=822368279

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0tog8m1a_1_1 RECID=41 STAMP=822368298

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0uog8pvi_1_1 RECID=42 STAMP=822372338

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/0vog8q07_1_1 RECID=43 STAMP=822372359

deleted backup piece

backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/10og8rop_1_1 RECID=44 STAMP=822374169

Deleted 22 objects

 


设定备份集的最大容量:

RMAN> backup database maxsetsize=100m;

 

Starting backup at 02-AUG-13

using channel ORA_DISK_1

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 08/02/2013 05:28:22

RMAN-06183: datafile or datafile copy /oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf (file number 1) larger than MAXSETSIZE



                                                                             -----------------------------备份报错,是因为设置的最大的容量低于单个数据文件的文件大小。

RMAN> backup database maxsetsize=700m;

 

Starting backup at 02-AUG-13

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=00001 name=/oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/13og8sgv_1_1 tag=TAG20130802T052903 comment=NONE

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

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=/oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

input datafile file number=00005 name=/oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

input datafile file number=00003 name=/oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/14og8sm6_1_1 tag=TAG20130802T052903 comment=NONE

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

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=/oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/15og8sn9_1_1 tag=TAG20130802T052903 comment=NONE

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

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

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 02-AUG-13

channel ORA_DISK_1: finished piece 1 at 02-AUG-13

piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/16og8snb_1_1 tag=TAG20130802T052903 comment=NONE

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

Finished backup at 02-AUG-13

 

RMAN> list backup;

 

 

List of Backup Sets

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

 

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

33      Full    597.17M    DISK        00:02:40     02-AUG-13     

        BP Key: 47   Status: AVAILABLE  Compressed: NO  Tag: TAG20130802T052903

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/13og8sgv_1_1

  List of Datafiles in backup set 33

  File LV Type Ckp SCN    Ckp Time  Name

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

  1       Full 1187116    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

34      Full    435.30M    DISK        00:00:35     02-AUG-13     

        BP Key: 48   Status: AVAILABLE  Compressed: NO  Tag: TAG20130802T052903

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/14og8sm6_1_1

  List of Datafiles in backup set 34

  File LV Type Ckp SCN    Ckp Time  Name

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

  2       Full 1187178    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf

  3       Full 1187178    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf

  5       Full 1187178    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

35      Full    6.30M      DISK        00:00:01     02-AUG-13     

        BP Key: 49   Status: AVAILABLE  Compressed: NO  Tag: TAG20130802T052903

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/15og8sn9_1_1

  List of Datafiles in backup set 35

  File LV Type Ckp SCN    Ckp Time  Name

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

  4       Full 1187195    02-AUG-13 /oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

36      Full    9.36M      DISK        00:00:03     02-AUG-13     

        BP Key: 50   Status: AVAILABLE  Compressed: NO  Tag: TAG20130802T052903

        Piece Name: /oracle/app/oracle/product/11.2.0/db_1/dbs/16og8snb_1_1

  SPFILE Included: Modification time: 02-AUG-13

  SPFILE db_unique_name: ORCL

  Control File Included: Ckp SCN: 1187195      Ckp time: 02-AUG-13

 

RMAN> exit


备份命令非常多,以上是一部分常用命令,如需了解更多备份方法和命令,请参照官网或者在博文下留言,我会陆续补充。





备份内容的状态信息查看,请参照:RMAN备份、恢复实验室 之 备份篇 【查看备份情况】


阅读(1353) | 评论(0) | 转发(0) |
0

上一篇:Oracle export 數據自動壓縮

下一篇:没有了

给主人留下些什么吧!~~