获得所有健康检查的列表:
sys@ORCL> select name from v$hm_check c where c.INTERNAL_CHECK='N';
NAME
------------------------------
DB Structure Integrity Check
CF Block Integrity Check
Data Block Integrity Check
Redo Integrity Check
Transaction Integrity Check
Undo Segment Integrity Check
Dictionary Integrity Check
ASM Allocation Check
已选择8行。
执行健康检查:
sys@ORCL> exec dbms_hm.run_check('Dictionary Integrity Check','testrun2');
PL/SQL 过程已成功完成。
查看健康检查结果:
sys@ORCL> select dbms_hm.get_run_report('testrun2') from dual;
DBMS_HM.GET_RUN_REPORT('TESTRUN2')
--------------------------------------------------------------------------------
Basic Run Information
Run Name : testrun2
Run Id : 2441
Check Name : Dictionary Integrity Check
Mode : MANUAL
Status : COMPLETED
Start Time : 2013-11-08 21:19:18.326787 +08:00
End Time : 2013-11-08 21:19:20.081483 +08:00
Error Encountered : 0
Source Incident Id : 0
Number of Incidents Created : 0
Input Paramters for the Run
TABLE_NAME=ALL_CORE_TABLES
CHECK_MASK=ALL
Run Findings And Recommendations
Finding
Finding Name : Dictionary Inconsistency
Finding ID : 2442
Type : FAILURE
Status : OPEN
Priority : CRITICAL
Message : SQL dictionary health check: file$ pk 42 on object FILE$
failed
Message : Damaged rowid is AAAAARAABAAAADpAAI - description: No further
damage description available
可以使用v$hm_finding和v$hm_recommendation来分析健康检查的发现,以及根据健康检查给出建议。
select * from v$hm_finding;
select * from v$hm_recommendation;