validate命令---rman进行备份和回复的验证(二)

2015-07-24 08:58:11 · 作者: · 浏览: 2
to 2; 3> backup database;}
RMAN> validate backupset 84;

using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /home/app/oraten/flash_recovery_area/ORATEN/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T152820_b5p8ro7v_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/app/oraten/flash_recovery_area/ORATEN/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T152820_b5p8ro7v_.bkp tag=TAG20141106T152820
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
validate命令验证的是备份的物理有效性而不是存储在备份中的数据块的物理有效性。

RESTORE ... PREVIEW

该命令进行restore命令的预演,可以在任何resotre命令后加上preview来进行还原预演,这个命令只是从数据字典读出需要的备份的元数据,不进行文件的验证。
You can apply RESTORE ... PREVIEW to any RESTORE operation to create a detailed list of every backup to be used in the requested RESTORE operation, as well as the necessary target SCN for recovery after the RESTORE operation is complete. This command accesses the RMAN repository to query the backup metadata, but does not actually read the backup files to ensure that they can be restored.

RMAN> restore database preview;

Starting restore at 2014-11-06 15:44:28
using channel ORA_DISK_1


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

BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
84      Full    551.76M    DISK        00:00:18     2014-11-06 15:28:24
        BP Key: 52   Status: AVAILABLE  Compressed: NO  Tag: TAG20141106T152820
        Piece Name: /home/app/oraten/flash_recovery_area/ORATEN/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T152820_b5p8ro7v_.bkp
  List of Datafiles in backup set 84
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  1       Full 922948     2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/system01.dbf
  2       Full 922948     2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/undotbs01.dbf
  3       Full 922948     2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/sysaux01.dbf
  4       Full 922948     2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/users01.dbf
  5       Full 922948     2014-11-06 15:28:20 /home/app/oraten/oradata/oraten/test01.dbf

archive logs generated after SCN 922948 not found in repository
Media recovery start SCN is 922948
Recovery must be done beyond SCN 922948 to clear data files fuzziness
Finished restore at 2014-11-06 15:44:28
RECOVER ... TEST:在内存中模拟recover过程,并不进行真正的recovery,可以用该命令来提起发现recovery中的问题。注意,模拟的recovery和正常recovery可能会遇到不同的问题。
A simulated recovery initiated with the RECOVER ... TEST command in RMAN or SQL*Plus. A trial recovery applies redo in a way similar to normal media recovery, but it never writes its changes to disk and it always rolls back its changes. Trial recovery occurs only in memory.
Trial recovery lets you foresee what problems might occur if you were to continue with normal recovery. For problems caused by ongoing memory corruption, trial recovery and normal recovery can encounter different errors.