[bbk5361] 第86集 -第11章 -数据库诊断 02
数据库恢复专家,在进行修复的时候,有2个项选,其中之一是无损修复,另外一种是有损修复,可供DBA选择.
执行ADVISE FAILURE与REPAIR FAILURE命令,必须是在同一个SESSION当中.修复工作,是无法并发操作的.
使用数据库恢复专家,有两种途径:OEM方式及Manual方式,接下来介绍一下Manual方式
Listing Data Failures
The RMAN LIST FAILURE command lists previously executed failure assessment.
- Including newly diagnosed failures
- Removing closed failures(by default)
Syntax:
LIST FAILURE [ ALL | CRITICAL | HIGH | LOW | CLOSED | failnum[,failnum,...]] [ EXCLUDE FAILURE failnum[,failnum,...]] [DETAIL]
Advising on Repair
The RMAN ADVISE FAILURE command:
- Displays a summary of input failure list
- Includes a warning,if new failures appeared in ADR
- Displays a manula checklist
- Lists a single recommended repair option
- Generates a repair script(for automatic or manual repair)
Executing Repairs
The RMAN REPAIR FAILURE command:
- Follows the ADVISE FAILURE command
- Repairs the specified failure
- Closes the repaired failure
Syntax:
REPAIR FAILURE [USING ADVISE OPTION integer] [ {{NOPROMPT | PREVIEW}}... ]
Classifying(and Closing) Failures
The RMAN CHANGE FAILURE command:
- Changes the failure priority(except for CRITICAL)(CHANGE FAILURE命令,可以将HIGH级别的故障,修改成LOW级别的故障.但是不可以将CRITICAL级别的故障,修改成HIGH级别的故障.)
- Closes one or more failures
Example:
Data Recovery Advisor Views
Querying V$ views:(查看动态性能视图,查看数据库恢复专家相关的动态性能视图)
- V$IR_FAILURE:List of all failures,including closed ones(result of the LIST FAILURE command)
- V$IR_MANULA_CHECKLIST:List of manual advice(result of the ADVISE FAILURE command)
- V$IR_REPAIR:List of repairs(result of the ADVISE FAILURE command)
- V$IR_FAILURE_SET:Cross-reference of failure and advice identifiers
Best Practice:Proactive Checks
DBA具备前瞻性的眼光,提前进行健康检查(主动防御、主动检查)
Invoking proactive health check of the database and its components:
- Health Monitor or RMAN VALIDATE DATABAES command
- Checking for logical and physical corruption
- Finding logged in the ADR