ORACLE:Health Monitor
轉(zhuǎn)載之:http://space.itpub.net/9466564/viewspace-609039
1. Health Monitor簡介
??? Health Monitor是11g里新增加的特性,用于數(shù)據(jù)庫的各層和各個(gè)組建的診斷檢查。例如可以檢查:文件損壞、物理邏輯塊損壞、redo和undo故障、數(shù)據(jù)字典損壞等。HM可以根據(jù)檢查的結(jié)果產(chǎn)生一個(gè)報(bào)表,并提供解決問題的建議。
???1.1 運(yùn)行方式:
??? 1). Reactive
???????? Fault diagnosability infrastructure能自動(dòng)響應(yīng)嚴(yán)重的錯(cuò)誤(critical error)。
???? 2). Manually
???????? 可以通過DBMS_HM系統(tǒng)包或 Enterprise Manager來手工運(yùn)行HM。
????1.2 運(yùn)行模式
????? 1). DB-ONLINE
????? 2). DB-OFFLINE
????? 所有HM都能在online模式下運(yùn)行,只有Redo Integrity Check 和 DB Structure Integrity Check能在offline模式下運(yùn)行。
????
2. HM的類型
??? 見附件詳細(xì)說明
??? 也可以通過視圖來查詢:
???SQL> SELECT name FROM v$hm_check WHERE internal_check='N';
???? NAME
???? ----------------------------------------------------------------
???? DB Structure Integrity Check
?????Data?Block Integrity Check
???? Redo Integrity Check
???? Transaction Integrity Check
???? Undo Segment Integrity Check
???? Dictionary Integrity Check
3. 手工運(yùn)行HM
???3.1 通過DBMS_HM系統(tǒng)包
???? 例如:
???? BEGIN
???????? DBMS_HM.RUN_CHECK('Dictionary Integrity Check', 'my_run');
???? END;
???? 該程序允許有輸入?yún)?shù),可以通過如下方式查找:
????SQL>SELECT c.name check_name, p.name parameter_name, p.type,p.default_value, p.description
?????????????? FROM v$hm_check_param p, v$hm_check c
?????????????? WHERE p.check_id = c.id and c.internal_check = 'N'
?????????????? ORDER BY c.name;
????? 帶參數(shù)實(shí)例:
???? BEGIN
???????? DBMS_HM.RUN_CHECK (
???????? check_name => 'Transaction Integrity Check',
???????? run_name => 'my_run',
???????? input_params => 'TXN_ID=7.33.2');
???? END;
????
????3.2 通過OEM允許
??????????Advisor Central -》Checkers -》 Run
4. 查看HM報(bào)表
???4.1 通過DBMS_HM系統(tǒng)包
???? 實(shí)例:
???SQL>SET LONG 100000
???SQL>SET LONGCHUNKSIZE 1000
???SQL>SET PAGESIZE 1000
???SQL>SET LINESIZE 512
???SQL>SELECT DBMS_HM.GET_RUN_REPORT('HM_RUN_1061')? FROM??? DUAL;
???? DBMS_HM.GET_RUN_REPORT('HM_RUN_1061')
??? -----------------------------------------------------------------------
???? Run Name???????????????????? : HM_RUN_1061
???? Run Id?????????????????????? : 1061
???? Check Name?????????????????? : Data Block Integrity Check
???? Mode???????????????????????? : REACTIVE
???? Status?????????????????????? : COMPLETED
???? Start Time?????????????????? : 2007-05-12 22:11:02.032292 -07:00
???? End Time???????????????????? : 2007-05-12 22:11:20.835135 -07:00
???? Error Encountered??????????? : 0
???? Source Incident Id?????????? : 7418
???? Number of Incidents Created? : 0
????
??? Input Paramters for the Run
???? BLC_DF_NUM=1
???? BLC_BL_NUM=64349
????
??? Run Findings And Recommendations
???? Finding
???? Finding Name? : Media Block Corruption
???? Finding ID??? : 1065
???? Type????????? : FAILURE
???? Status??????? : OPEN
???? Priority????? : HIGH
???? Message?????? : Block 64349 in datafile 1:
?????????????????? '/ade/sfogel_emdb/oracle/dbs/t_db1.f' is media corrupt
???? Message?????? : Object BMRTEST1 owned by SYS might be unavailable
???? Finding
???? Finding Name? : Media Block Corruption
???? Finding ID??? : 1071
???? Type????????? : FAILURE
???? Status??????? : OPEN
???? Priority????? : HIGH
???? Message?????? : Block 64351 in datafile 1:
?????????????????? '/ade/sfogel_emdb/oracle/dbs/t_db1.f' is media corrupt
???? Message?????? : Object BMRTEST2 owned by SYS might be unavailable
????4.2 通過ADRCI查看
????adrci> show hm_run
???
??? ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
??? *************************************************************************
???
??? **********************************************************
??? HM RUN RECORD 1
??? **********************************************************
?????? RUN_ID??????????????????????? 1
?????? RUN_NAME????????????????????? liang
?????? CHECK_NAME??????????????????? Dictionary Integrity Check
?????? NAME_ID?????????????????????? 24
?????? MODE????????????????????????? 0
?????? START_TIME??????????????????? 2009-07-13 17:31:46.436329 +08:00
?????? RESUME_TIME?????????????????? <NULL>
?????? END_TIME????????????????????? 2009-07-13 17:31:58.773625 +08:00
?????? MODIFIED_TIME???????????????? 2009-07-13 17:31:58.773625 +08:00
?????? TIMEOUT?????????????????????? 0
?????? FLAGS???????????????????????? 0
?????? STATUS??????????????????????? 5
?????? SRC_INCIDENT_ID?????????????? 0
?????? NUM_INCIDENTS???????????????? 0
?????? ERR_NUMBER??????????????????? 0
?????? REPORT_FILE?????????????????? <NULL>
??? 1 rows fetched
???
???adrci> create report hm_run liang
??? adrci> show report hm_run liang
??? <?xml version="1.0" encoding="US-ASCII"?>
??? <HM-REPORT REPORT_ID="liang">
??????? <TITLE>HM Report: liang</TITLE>
??????? <RUN_INFO>
??????????? <CHECK_NAME>Dictionary Integrity Check</CHECK_NAME>
??????????? <RUN_ID>1</RUN_ID>
??????????? <RUN_NAME>liang</RUN_NAME>
??????????? <RUN_MODE>MANUAL</RUN_MODE>
??????????? <RUN_STATUS>COMPLETED</RUN_STATUS>
??????????? <RUN_ERROR_NUM>0</RUN_ERROR_NUM>
??????????? <SOURCE_INCIDENT_ID>0</SOURCE_INCIDENT_ID>
??????????? <NUM_INCIDENTS_CREATED>0</NUM_INCIDENTS_CREATED>
??????????? <RUN_START_TIME>2009-07-13 17:31:46.436329 +08:00</RUN_START_TIME>
??????????? <RUN_END_TIME>2009-07-13 17:31:58.773625 +08:00</RUN_END_TIME>
??????? </RUN_INFO>
??????? <RUN_PARAMETERS>
??????????? <RUN_PARAMETER>TABLE_NAME=ALL_CORE_TABLES</RUN_PARAMETER>
??????????? <RUN_PARAMETER>CHECK_MASK=ALL</RUN_PARAMETER>
??????? </RUN_PARAMETERS>
??????? <RUN-FINDINGS/>
???4.3 通過OEM
??????????Advisor Central -》Checkers-》Runs -》View Report
5. HM視圖
??? 除了可以創(chuàng)建一個(gè)checker報(bào)表外,還可以在ADR里直接查看已經(jīng)產(chǎn)生的報(bào)表??刹榭吹囊晥D有:
???V$HM_RUN,V$HM_FINDING, andV$HM_RECOMMENDATION.
???? 例如:
??? SQL>
RUN_ID NAME CHECK_NAME RUN_MODE SRC_INCIDENT
---------- ------------ ---------------------------------- -------- ------------
1 HM_RUN_1 DB Structure Integrity Check REACTIVE 0
101 HM_RUN_101 Transaction Integrity Check REACTIVE 6073
121 TXNCHK Transaction Integrity Check MANUAL 0
181 HMR_tab$ Dictionary Integrity Check MANUAL 0
.
.
.
981 Proct_ts$ Dictionary Integrity Check MANUAL 0
1041 HM_RUN_1041 DB Structure Integrity Check REACTIVE 0
1061 HM_RUN_1061 Data Block Integrity Check REACTIVE 7418
TYPE DESCRIPTION
------------- -----------------------------------------
FAILURE Block 64349 in datafile 1: '/ade/sfogel_e
mdb/oracle/dbs/t_db1.f' is media corrupt
FAILURE Block 64351 in datafile 1: '/ade/sfogel_e
mdb/oracle/dbs/t_db1.f' is media corrupt
?
Types of Health Checks
Health Check Parameters Reference 01
Health Check Parameters Reference 02
總結(jié)
以上是生活随笔為你收集整理的ORACLE:Health Monitor的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ASM元数据备份与恢复:md_backu
- 下一篇: 可变大小区(Variable-Size