※这是对于工具备份/恢复、重要参数、策略等的一篇十分难得的详细阐述的文章,学习后,收益匪浅。
为了今后查阅方便,在这里转载一下。感谢lvqf朋友的精彩整理。
原文作者 lvqf
本文原载地址
http://lvqf.itpub.net/post/42935/516163
http://lvqf.itpub.net/post/42935/516165
http://lvqf.itpub.net/post/42935/516168
http://lvqf.itpub.net/post/42935/516220
(一)备份/恢复原理揭晓
RMAN是一种支持在线备份的工具,RMAN的备份不能在间或平台间进行移动,主要用于物理备份(一种热备份,即备份时也要归档)。即实现从一个目录复制物理数据库文件到另一个目录,文件包括:数据文件,物理文件,归档日志(不包括联机日志)。默认存储在闪回区(由参数db_recovery_file_dest决定),物理在D:oracleproduct10.2.0flash_recovery_area下
几个概念:channel:通道,piece:备份片(BP),backupset:备份集(BS),tag:同一次生成备份的唯一标志,type:备份类型(full:完全备份,部分备份)。
例子1:备份、恢复的简单过程
C:>rman
RMAN> connect target/*从RMAN连接到数据库*/
connected to target database: TEST (DBID=2044507409)
RMAN> backup database; /*备份整个数据库*/
Starting backup at 06-APR-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
input datafile fno=00002 name=D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
input datafile fno=00003 name=D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
input datafile fno=00006 name=D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
input datafile fno=00007 name=D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
input datafile fno=00004 name=D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
input datafile fno=00005 name=D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
channel ORA_DISK_1: starting piece 1 at 06-APR-11
channel ORA_DISK_1: finished piece 1 at 06-APR-11
piece handle=D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET2011_04
_06O1_MF_NNNDF_TAG20110406T212439_6SRTDR0H_.BKP tag=TAG20110406T212439 comment=
NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 06-APR-11
channel ORA_DISK_1: finished piece 1 at 06-APR-11
piece handle=D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET2011_04
_06O1_MF_NCSNF_TAG20110406T212439_6SRTHH6C_.BKP tag=TAG20110406T212439 comment=
NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
Finished backup at 06-APR-11
-------其他备份命令--------
Backup tablespace users;
Backup datafile 4;---备份4号数据文件
Backup current controlfile;---一般数据库的控制文件类型都是current
Backup archivelog;---备份归档日志
Backup archivelog all not backed up;---只备份之前没备份过的归档日志
Backup archivelog all not backed up delete input;--备份同时删除归档目录下相应的归档日志
Backup db_recovery_file_dest;---备份闪回区,需备份在磁带上
另外,10G开始支持备份集压缩,例如:Backup as compressed backupset full database format =’d:temp%d_%T_%U.BAK’,即将整个数据库压缩备份到指定D:TEMP目录下,%d:表数据库名,%T:表备份日期,%U:唯一的文件名,=号在备份spfile时必须有。
---------
RMAN> list backup of database summary;----展示数据库所有备份统计信息
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
14 B F A DISK 06-APR-11 1 1 NO TAG201104
06T212439
注:list backup of database/control 或者list backup ;---展示详细信息
--------备份完成,下面进行恢复--------
C:Documents and SettingsAdministrator>sqlplus test/test
SQL> alter system switch logfile;----要进行联机日志归档一下,这样RMAN恢复时才可以恢复归档日志
-----
RMAN> restore preview database;---预览恢复
Starting restore at 06-APR-11
using channel ORA_DISK_1
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
14 Full 633.53M DISK 00:01:17 06-APR-11
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20110406T212439
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_06O1_MF_NNNDF_TAG20110406T212439_6SRTDR0H_.BKP
List of Datafiles in backup set 14
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 768310 06-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 Full 768310 06-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 Full 768310 06-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 Full 768310 06-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 Full 768310 06-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 Full 768310 06-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 Full 768310 06-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
8 1 47 A 06-APR-11 D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATE
STARCHIVELOG2011_04_06O1_MF_1_47_6SRY3N5C_.ARC
Media recovery start SCN is 768310
Recovery must be done beyond SCN 768310 to clear files fuzziness
Finished restore at 06-APR-11
RMAN> shutdown immediate ----关闭数据库
database closed
database dismounted
instance shut down
-------此时,再手工删除表空间USERS,SYSTEM,SYSAUX的数据文件
RMAN> startup ----发现数据库只能启动到mount状态,因为控制文件还在
connected to target database (not started)
Oracle instance started
database mounted
RMAN-00571: ==================================================
RMAN-00569: ========= ERROR MESSAGE STACK FOLLOWS =========
RMAN-00571:==================================================
RMAN-03002: failure of startup command at 04/06/2011 22:37:08
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: 'D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF'
RMAN> restore database;----用刚才的备份还原数据库
RMAN> alter database open;---发现还是不能打开数据库,此时需要用刚才在数据库里切换归档的日志进行恢复
RMAN-00571:===================================================
RMAN-00569:============ ERROR MESSAGE STACK FOLLOWS =========
RMAN-00571:====================================================
RMAN-03002: failure of alter db command at 04/06/2011 22:42:41
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: 'D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF'
RMAN> recover database;----恢复数据库
RMAN> alter database open;---成功完成恢复
database opened
例子2:删除备份
RMAN> list backup of database summary;---查看目前有哪些备份
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
14 B F A DISK 06-APR-11 1 1 NO TAG20110406T212439
16 B F A DISK 06-APR-11 1 1 NO TAG20110406T225045
17 B F A DISK 06-APR-11 1 1 NO TAG20110406T225103
----此时手工删除备份集为17的数据文件备份
RMAN> delete backupset 17;---发现会报错,因为手工删除后,ORACLE并不知道已删除
RMAN> crosscheck backupset 17;----刷新这个备份集状态为(expired:过期)
using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_06O1_MF_NNNDF_TAG20110406T225103_6SRZGR5V_.BKP recid=17 stamp=747787864
Crosschecked 1 objects
RMAN> delete nopromt backupset 17;---此时成功删除备份集17,nopromt不提示是否删除
---其他删除命令----
Delete backup;---删除全部备份
Delete expired backupset;---删除全部过期备份集,备份信息保留在控制文件中,且保留时间取决于数据库参数control_file_record_keep_time (show parameter record默认为7天)。
------------------
RMAN中FORMAT的%
%c 备份片的拷贝数
%d 数据库名称
%D 位于该月中的第几天 (DD)
%M 位于该年中的第几月 (MM)
%F 一个基于DBID唯一的名称,这个格式的形式为c-IIIIIIIIII-YYYYMMDD-QQ,其中IIIIIIIIII为该数据库的DBID,YYYYMMDD为日期,QQ是一个1-256的序列
%n 数据库名称,向右填补到最大八个字符
%u 一个八个字符的名称代表备份集与创建时间
%p 该备份集中的备份片号,从1开始到创建的文件数
%U 一个唯一的文件名,代表%u_%p_%c
%s 备份集的号
%t 备份集时间戳
%T 年月日格式(YYYYMMDD)
(二) 重要参数详解
RMAN重要参数详解
RMAN> show all;---展示全部参数
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:ORACLEPRODUCT10.2.0DB_1DATABASESNCFTSID.ORA'; # default
1)1) 保存策略(设置冗余或设置保留窗口)
RMAN>CONFIGURE RETENTION POLICY TO REDUNDANCY 1;---默认保留一份有效的冗余备份,虽然在磁盘上存在多份相同备份,但RMAN恢复时只使用最新的有效备份。
RMAN>CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;--设置保存策略为7天,即SYSDATE - BACKUP CHECKPOINT TIME >= 7时,备份标志为obsolete废弃,但RMAN不会自动删除废弃备份,且仍然可以用于RMAN恢复。(即obsolete means "not needed”, expired means "not found.")。
RMAN>REPORT OBSOLETE or DELETE OBSOLETE;--展示废弃备份/删除废弃备份
两者相比,设置冗余能使保存策略保留每个数据文件确定的备份集数量,使磁盘空间使用率计划更简易。
2)2) 设备类型:主要为磁盘(备份集),磁带(镜像拷贝)
RMAN>CONFIGURE DEFAULT DEVICE TYPE TO DISK/sbt; ---默认备份到磁盘
3)3) 并行度参数PARALLELISM:确定CHANNEL通道的数量,加快备份速度。原则上一个物理设备分配一个通道最优。
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 1;--默认为1
4)4) 备份类型:备份集、镜像拷贝(即文件拷贝)
RMAN>CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET/COPY;--默认为备份集,磁带只支持备份集。文件拷贝耗资耗时大
RMAN>CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
5)5) 备份优化
CONFIGURE BACKUP OPTIMIZATION OFF;---默认优化方式是不打开的,如果打开的ON,则BACKUP command不再备份已备份过的文件。
6)还原缺省值,用clear
RMAN> CONFIGURE BACKUP OPTIMIZATION CLEAR;
7) RETENTION POLICY优先于BACKUP OPTIMIZATION(OCP 043有道考题涉及)
(三) catalog 与 nocatalog
1. Nocatalog:RMAN默认这种方式连接数据库,这种方式的每次备份信息会记录在控制文件中,因此有必要将控制文件镜像拷贝在不同磁盘不同目录,且备份信息保留市场与之前说到的参数control_file_record_keep_time有关。备份恢复过程前面文章以介绍,在此不再说明。恢复数据库需要启动到MOUNT模式,访问控制文件。
2. Catalog:必须要在专用模式数据库里有自己的恢复目录,用于存放目标数据库备份信息,创建对象的脚本,RMAN的元数据信息。(一个目录可以存放多个目标数据库备份信息,以DBID作为唯一标识)
例子:CATALOG部署过程(在这里就不新建一个专用数据库了)
C:Documents and SettingsAdministrator>sqlplus / as sysdba
SQL> create user rman identified by rman;--创建一个RMAN用户
SQL> grant connect,resource,recovery_catalog_owner to rman;--授予用户角色,查看角色包含哪些权限(select * from role_sys_privs
where role like '%RECOVERY_CATALOG_OWNER%'; )
C:Documents and SettingsAdministrator>rman targetcatalog------连接到目标数据库的catalog目录
Recovery Manager: Release 10.2.0.1.0 - Production on Thu Apr 7 09:51:03 2011
Copyright (c) 1982, , Oracle. All rights reserved.
connected to target database: TEST (DBID=2044507409)
connected to recovery catalog database
RMAN> create catalog tablespace users;--创建一个新的恢复目录
RMAN> register database;---注册该目标数据库到恢复目录中,唯一标识:DBID=2044507409
---部署完成
(四) 增量备份级别测试
RMAN备份方式分为:完全备份、增量备份(差异备份和累计备份)
差异备份(differential):只备份 离最近一次增量备份后 所有改变的块。(增量备份默认方式)
累计备份(cumulative):基于最近一次0级增量备份后,所有改变的块。
完全备份与0 级备份不同之处就在于完全备份永远不会包含在增量备份策略中。
以下环境:32-bit Windows,ORACLE 10.2.0.1.0,归档模式
例子1:
验证:没有0级备份下,多次0级以上同等级的累计备份其本质都是0 级备份(从备份集大小可以看出),使用最新一次备份用于恢复
RMAN> list backupset;
RMAN> backup as compressed backupset incremental level=1 cumulative database;
---另一个窗口中--
SQL> insert into test.t1 values(8);
1 row created.
SQL> commit;
Commit complete.
SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered.
-----
RMAN> backup as compressed backupset incremental level=1 cumulative database;
-----
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
70 Incr 1 128.57M DISK 00:00:54 08-APR-11
BP Key: 70 Status: AVAILABLE Compressed: YES Tag: TAG20110408T051858
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET2011_04_08O1_MF_NNND1_TAG20110408T051858_6SWBL3N0_.BKP
List of Datafiles in backup set 70
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 1 Incr 835220 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 1 Incr 835220 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 1 Incr 835220 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 1 Incr 835220 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 1 Incr 835220 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 1 Incr 835220 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 1 Incr 835220 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
71 Incr 1 1.06M DISK 00:00:04 08-APR-11
BP Key: 71 Status: AVAILABLE Compressed: YES Tag: TAG20110408T051858
Piece Name:D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET2011_04_08O1_MF_NCSN1_TAG20110408T051858_6SWBMX00_.BKP
Control File Included: Ckp SCN: 835238 Ckp time: 08-APR-11
SPFILE Included: Modification time: 08-APR-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
72 Incr 1 128.57M DISK 00:00:56 08-APR-11
BP Key: 72 Status: AVAILABLE Compressed: YES Tag: TAG20110408T052313
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET2011_04_08O1_MF_NNND1_TAG20110408T052313_6SWBT1TV_.BKP
List of Datafiles in backup set 72
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
73 Incr 1 1.06M DISK 00:00:03 08-APR-11
BP Key: 73 Status: AVAILABLE Compressed: YES Tag: TAG20110408T052313
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NCSN1_TAG20110408T052313_6SWBW5C7_.BKP
Control File Included: Ckp SCN: 835338 Ckp time: 08-APR-11
SPFILE Included: Modification time: 08-APR-11
-----预览恢复-----
RMAN> restore preview database;
Starting restore at 08-APR-11
using channel ORA_DISK_1
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
72 Incr 1 128.57M DISK 00:00:56 08-APR-11
BP Key: 72 Status: AVAILABLE Compressed: YES Tag: TAG20110408T052313
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NNND1_TAG20110408T052313_6SWBT1TV_.BKP
List of Datafiles in backup set 72
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 1 Incr 835316 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
archive logs generated after SCN 835316 not found in repository
Media recovery start SCN is 835316
Recovery must be done beyond SCN 835316 to clear data files fuzziness
Finished restore at 08-APR-11
---验证完毕-----
例子2:
验证:依次进行2,3,3级累计备份,则2级备份本质是0 级备份,3级则为真正累计备份,恢复时使用2级和最新一次3级累计备份
RMAN> list backupset;
RMAN> backup as compressed backupset incremental level=2 cumulative database;
---另一个窗口中--
SQL> insert into test.t1 values(8);
1 row created.
SQL> commit;
Commit complete.
SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered.
-----
RMAN> backup as compressed backupset incremental level=3 cumulative database;
---另一个窗口中--
SQL> insert into test.t1 values(8);
1 row created.
SQL> commit;
Commit complete.
SQL> select count(*) from test.t1;
COUNT(*)
----------
20
SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered.
-------
RMAN> backup as compressed backupset incremental level=3 cumulative database;
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
64 Incr 2 128.41M DISK 00:00:56 08-APR-11
BP Key: 64 Status: AVAILABLE Compressed: YES Tag: TAG20110408T050720
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NNND2_TAG20110408T050720_6SW9W9GN_.BKP
List of Datafiles in backup set 64
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
65 Incr 2 1.06M DISK 00:00:04 08-APR-11
BP Key: 65 Status: AVAILABLE Compressed: YES Tag: TAG20110408T050720
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NCSN2_TAG20110408T050720_6SW9YDXS_.BKP
Control File Included: Ckp SCN: 834369 Ckp time: 08-APR-11
SPFILE Included: Modification time: 08-APR-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
66 Incr 3 1.09M DISK 00:00:33 08-APR-11
BP Key: 66 Status: AVAILABLE Compressed: YES Tag: TAG20110408T050919
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NNND3_TAG20110408T050919_6SWB00LK_.BKP
List of Datafiles in backup set 66
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 3 Incr 834398 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 3 Incr 834398 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 3 Incr 834398 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 3 Incr 834398 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 3 Incr 834398 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 3 Incr 834398 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 3 Incr 834398 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
67 Incr 3 1.06M DISK 00:00:03 08-APR-11
BP Key: 67 Status: AVAILABLE Compressed: YES Tag: TAG20110408T050919
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NCSN3_TAG20110408T050919_6SWB156C_.BKP
Control File Included: Ckp SCN: 834409 Ckp time: 08-APR-11
SPFILE Included: Modification time: 08-APR-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
68 Incr 3 1.09M DISK 00:00:32 08-APR-11
BP Key: 68 Status: AVAILABLE Compressed: YES Tag: TAG20110408T051127
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NNND3_TAG20110408T051127_6SWB3ZQG_.BKP
List of Datafiles in backup set 68
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
69 Incr 3 1.06M DISK 00:00:04 08-APR-11
BP Key: 69 Status: AVAILABLE Compressed: YES Tag: TAG20110408T051127
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NCSN3_TAG20110408T051127_6SWB552X_.BKP
Control File Included: Ckp SCN: 834466 Ckp time: 08-APR-11
SPFILE Included: Modification time: 08-APR-11
----预览恢复,发现分别用到2级和最新的一次3级备份----
RMAN> restore preview database;
Starting restore at 08-APR-11
using channel ORA_DISK_1
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
64 Incr 2 128.41M DISK 00:00:56 08-APR-11
BP Key: 64 Status: AVAILABLE Compressed: YES Tag: TAG20110408T050720
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NNND2_TAG20110408T050720_6SW9W9GN_.BKP
List of Datafiles in backup set 64
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 2 Incr 834275 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
68 Incr 3 1.09M DISK 00:00:32 08-APR-11
BP Key: 68 Status: AVAILABLE Compressed: YES Tag: TAG20110408T051127
Piece Name: D:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREATESTBACKUPSET
2011_04_08O1_MF_NNND3_TAG20110408T051127_6SWB3ZQG_.BKP
List of Datafiles in backup set 68
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF
2 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS01.DBF
3 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTSYSAUX01.DBF
4 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUSERS01.DBF
5 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP101.DBF
6 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTTEMP02.DBF
7 3 Incr 834454 08-APR-11 D:ORACLEPRODUCT10.2.0ORADATATESTUNDOTBS02.DBF
archive logs generated after SCN 834454 not found in repository
Media recovery start SCN is 834454
Recovery must be done beyond SCN 834454 to clear data files fuzziness
Finished restore at 08-APR-11
---验证完毕---