Oracle 11g Health Monitor健康监控(3)

3.定位你要创建报告的检查并注意检查运行的名称.如果检查报告已经存在那么report_file字段就会包含一个文件名比如上面的
/u01/app/Oracle/diag/rdbms/jycs/jycs/hm/HMREPORT_jy_dict_run.hm.否则使用下面的命令来生成一个报告.
adrci> create report hm_run jy_dict_run_1
DIA-48448: This command does not support multiple ADR homes

这是因为当前存在多个ADR home目录
adrci> show homes
ADR Homes:
diag/tnslsnr/jyrac1/listener
diag/rdbms/cs/cs
diag/rdbms/jytest/jytest
diag/rdbms/jy/jy
diag/rdbms/jycs/jycs
adrci> set homepath diag/rdbms/jycs/jycs
adrci> create report hm_run jy_dict_run_1

4.执行以下命令来查看报告:
adrci> show report hm_run jy_dict_run_1
< ?xml version="1.0" encoding="US-ASCII"?>HM Report: jy_dict_run_1
<run_info>
<check_name>Dictionary Integrity Check
<run_id>101
<run_name>jy_dict_run_1
<run_mode>MANUAL
<run_status>COMPLETED
<run_error_num>0
<source_incident_id>0
<num_incidents_created>0
<run_start_time>2014-06-11 17:27:13.477462 +08:00
<run_end_time>2014-06-11 17:27:14.734166 +08:00

<run_parameters>
<run_parameter>TABLE_NAME=ALL_CORE_TABLES
<run_parameter>CHECK_MASK=ALL


health monitor视图
可以用视图来代替检查报告来查看特定检查的结果.可用的视图有v$hm_run,v$hm_finding,v$hm_recommendation
下面查询v$hm_run来判断运行检查的确良历史信息:
SQL> SELECT run_id, name, check_name, run_mode, src_incident FROM v$hm_run;

RUN_ID NAME CHECK_NAME RUN_MODE SRC_INCIDENT
---------- -------------------------------- -------------------------------- -------- ------------
61 HM_RUN_61 DB Structure Integrity Check REACTIVE 0
81 jy_dict_run Dictionary Integrity Check MANUAL 0
101 jy_dict_run_1 Dictionary Integrity Check MANUAL 0
1 HM_RUN_1 DB Structure Integrity Check REACTIVE 0


下面查询v$hm_finding来获得RUN_ID 61的详细信息:
SELECT type, description FROM v$hm_finding WHERE run_id = 61;
TYPE DESCRIPTION
------------- -----------------------------------------------------------------------------
FAILURE Block 64349 in datafile 1: '/u01/app/oracle/dbs/t_db1.f' is media corrupt
FAILURE Block 64351 in datafile 1: '/u01/app/oracle/dbs/t_db1.f' is media corrupt

health check参数
Table 9–6 Parameters for Data Block Integrity Check
------------------------------------------------------------------------------------------------------------------
Parameter Name Type Default Value Description
------------------------------------------------------------------------------------------------------------------
BLC_DF_NUM Number (none) Block datafile number
BLC_BL_NUM Number (none) Data block number
------------------------------------------------------------------------------------------------------------------


Table 9–7 Parameters for Redo Integrity Check
------------------------------------------------------------------------------------------------------------------
Parameter Name Type Default Value Description
------------------------------------------------------------------------------------------------------------------
SCN_TEXT Text 0 SCN of the latest good redo (if known)
------------------------------------------------------------------------------------------------------------------


Table 9–8 Parameters for Undo Segment Integrity Check
------------------------------------------------------------------------------------------------------------------
Parameter Name Type Default Value Description
------------------------------------------------------------------------------------------------------------------
USN_NUMBER Text (none) Undo segment number
------------------------------------------------------------------------------------------------------------------


Table 9–9 Parameters for Transaction Integrity Check
------------------------------------------------------------------------------------------------------------------
Parameter Name Type Default Value Description
------------------------------------------------------------------------------------------------------------------
TXN_ID Text (none) Transaction ID
------------------------------------------------------------------------------------------------------------------

Table 9–10 Parameters for Dictionary Integrity Check
------------------------------------------------------------------------------------------------------------------
Parameter Name Type Default Value Description
------------------------------------------------------------------------------------------------------------------
CHECK_MASK Text ALL Possible values are:
COLUMN_CHECKS—Run column
checks only. Verify column-level
constraints in the core tables.

ROW_CHECKS—Run row checks only.
Verify row-level constraints in the
core tables.

REFERENTIAL_CHECKS—Run
referential checks only. Verify
referential constraints in the core
tables.

ALL—Run all checks.

TABLE_NAME Text ALL_CORE_TABLES Name of a single core table to check. If
omitted, all core tables are checked.
------------------------------------------------------------------------------------------------------------------

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/4eef9f799f2cda853e5928b24ad801db.html