1.先看看版本嘛
RMAN> select * from v$version;
BANNER CON_ID
--------------------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0
PL/SQL Release 12.1.0.2.0 - Production 0
CORE 12.1.0.2.0 Production 0
TNS for Linux: Version 12.1.0.2.0 - Production 0
NLSRTL Version 12.1.0.2.0 - Production 0
2.看看控制文件能否恢复到一天前
RMAN> restore controlfile until time 'sysdate-1' validate;
Starting restore at 18-AUG-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile backup set
channel ORA_DISK_1: reading from backup piece +FRA/ORCL/BACKUPSET/2019_08_17/ncsnf0_tag20190817t124952_0.261.1016542289
channel ORA_DISK_1: piece handle=+FRA/ORCL/BACKUPSET/2019_08_17/ncsnf0_tag20190817t124952_0.261.1016542289 tag=TAG20190817T124952
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
Finished restore at 18-AUG-19
哇,还真的在读哈 。
3.看看参数文件可否
RMAN> restore spfile until time 'sysdate-1' validate;
Starting restore at 18-AUG-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile backup set
channel ORA_DISK_1: reading from backup piece +FRA/ORCL/BACKUPSET/2019_08_17/ncsnf0_tag20190817t124952_0.261.1016542289
channel ORA_DISK_1: piece handle=+FRA/ORCL/BACKUPSET/2019_08_17/ncsnf0_tag20190817t124952_0.261.1016542289 tag=TAG20190817T124952
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
Finished restore at 18-AUG-19
RMAN>
RMAN>
4.看看数据库呢
RMAN> restore database until time 'sysdate-1' validate;
Starting restore at 18-AUG-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile backup set
channel ORA_DISK_1: reading from backup piece +FRA/ORCL/BACKUPSET/2019_08_17/nnndf0_tag20190817t124952_0.260.1016542193
channel ORA_DISK_1: piece handle=+FRA/ORCL/BACKUPSET/2019_08_17/nnndf0_tag20190817t124952_0.260.1016542193 tag=TAG20190817T124952
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: validation complete, elapsed time: 00:00:03
Finished restore at 18-AUG-19
5.如果有磁带的情况,能否验证呢
RMAN> run{
2> allocate channel c1 device type sbt;
3> restore database validate;
4> }
released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=266 device type=SBT_TAPE
channel c1: Oracle Secure Backup
Starting restore at 18-AUG-19
new media label is "rman-000005,rman-000007,rman-000008,rman-000009,rman-000010,rman-000011" for piece "07u9hdc7_1_1"
channel c1: starting validation of datafile backup set
channel c1: reading from backup piece 07u9hdc7_1_1
channel c1: piece handle=07u9hdc7_1_1 tag=TAG20190818T161503
channel c1: restored backup piece 1
channel c1: validation complete, elapsed time: 00:00:45
Finished restore at 18-AUG-19
released channel: c1