修复故障示例
RMAN>REPAIR FAILURE PREVIEW;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/Oracle/diag/rdbms/orcl/orcl/hm/reco_2101176755.hm
contents of repair script:
# restore and recover datafile
restore datafile 4;
recover datafile 4;
RMAN>REPAIR FAILURE;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_2101176755.hm
contents of repair script:
# restore and recover datafile
restore datafile 4;
recover datafile 4;
Do you really want to execute the above repair (enter YES or NO)? YES
executing repair script
Starting restore at 21-JUN-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to
/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: reading from backup piece
/u01/app/oracle/flash_recovery_area/ORCL/backupset/2007_06_21/o1_mf_nnnd
f_TAG20070621T043615_37m7gpfp_.bkp
channel ORA_DISK_1: piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2007_06_21/o1_
mf_nnndf_TAG20070621T043615_37m7gpfp_.bkp tag=TAG20070621T043615
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 21-JUN-07
Starting recover at 21-JUN-07
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 20 is already on disk as file
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1_mf_1_2
0_37m7lhgx_.arc
archived log for thread 1 with sequence 21 is already on disk as file
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1_mf_1_2
1_37m7llgp_.arc
archived log for thread 1 with sequence 22 is already on disk as file
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1_mf_1_2
2_37m7logv_.arc
archived log for thread 1 with sequence 23 is already on disk as file
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1_mf_1_2
3_37n046y3_.arc
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=16
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=17
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=18
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=19
channel ORA_DISK_1: reading from backup piece
/u01/app/oracle/flash_recovery_area/ORCL/backupset/2007_06_21/o1_mf_an
nnn_TAG20070621T043805_37m7l46t_.bkp
channel ORA_DISK_1: piece
handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2007_06_21/o
1_mf_annnn_TAG20070621T043805_37m7l46t_.bkp tag=TAG20070621T043805
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_16_37n7ptq0_.arc thread=1 sequence=16
channel default: deleting archived log(s)
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_16_37n7ptq0_.arc RECID=20 STAMP=625844810
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_17_37n7ptrv_.arc thread=1 sequence=17
channel default: deleting archived log(s)
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_17_37n7ptrv_.arc RECID=22 STAMP=625844810
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_18_37n7ptqo_.arc thread=1 sequence=18
channel default: deleting archived log(s)
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_18_37n7ptqo_.arc RECID=21 STAMP=625844810
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_19_37n7ptsh_.arc thread=1 sequence=19
channel default: deleting archived log(s)
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_19_37n7ptsh_.arc RECID=23 STAMP=625844810
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_20_37m7lhgx_.arc thread=1 sequence=20
archived log file
name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2007_06_21/o1
_mf_1_21_37m7llgp_.arc thread=1 sequence=21
media recovery complete, elapsed time: 00:00:01
Finished recover at 21-JUN-07
repair failure complete
Do you want to open the database (enter YES or NO)? YES
database opened
RMAN>
- 分类(和关闭)故障
RMAN CHANGE FAILURE 命令有以下用途:
• 更改故障优先级(除CRITICAL 外)
• 关闭一个或多个故障
示例:
RMAN>change failure 5 priority low;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
5 HIGH OPEN 20-DEC-06 one or more
datafiles are missing
Do you really want to change the above failures (enter YES or
NO)? yes
changed 1 failures to LOW priority
分类(和关闭)故障
CHANGE FAILURE 命令用于更改故障优先级或关闭一个或多个故障。
语法
CHANGE FAILURE
{ ALL | CRITICAL | HIGH | LOW | failnum[,failnum,…] }
[ EXCLUDE FAILURE failnum[,failnum, …] ]
{ PRIORITY {CRITICAL | HIGH | LOW} | CLOSE }-将故障的状态更改为已关闭
[ NOPROMPT ]-不要求用户进行确认
只能将故障优先级从HIGH 更改为LOW 和从LOW 更改为HIGH。更改CRITICAL 优先级会出现错误。(将故障的优先级从HIGH 更改为LOW 的一个原因是为了避免该故障显示在LIST FAILURE命令的默认输出列表中。例如,如果块损坏具有HIGH 优先级,则该块位于很少使用的表空间中时,您可能希望将其临时更改为LOW 。)
修复故障后,将隐式关闭打开的故障。但是,也可以显式关闭故障。这需要重新评估其它所有打开的故障,因为其中的某些故障会因故障关闭而变得不相关。
默认情况下,该命令要求用户确认请求的更改。
