加入收藏 | 设为首页 | 会员中心 | 我要投稿 核心网 (https://www.hxwgxz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长百科 > 正文

Oracle 11g Health Monitor Checks

发布时间:2021-01-11 18:11:37 所属栏目:站长百科 来源:网络整理
导读:说明: Health Monitor是11g引入的用于检查数据库的各个组件(包括文件、内存、事务处理完整性、 元数据和进程使用情况)。这些检查器将生成检查结果报表以及解决问题的建议。 可在数据库脱机(nomount)和联机(open或mount)的情况下执行,运行状况检查都可

3.Redo Integrity Check—This check scans the contents of the redo log for accessibility and corruption,as well as the archive logs,if available. The Redo Integrity Check reports failures such as archive log or redo corruption.

--在线日志及归档都会进行检查

4.Undo Segment Integrity Check—This check finds logical undo corruptions. After locating an undo corruption,this check uses PMON and SMON to try to recover the corrupted transaction. If this recovery fails,then Health Monitor stores information about the corruption in V$CORRUPT_XID_LIST. Most undo corruptions can be resolved by forcing a commit.

--PMON和SMON尝试恢复损坏的事务,当损坏的事务不能恢复时记录在V$CORRUPT_XID_LIST视图中。

5.Transaction Integrity Check—This check is identical to the Undo Segment Integrity Check except that it checks only one specific transaction.

--与4相同

6.Dictionary Integrity Check—This check examines the integrity of core dictionary objects,such as tab$ and col$. It performs the following operations:
1)Verifies the contents of dictionary entries for each dictionary object.
--验证每个字典对象的字典条目的内容。
2)Performs a cross-row level check,which verifies that logical constraints on rows in the dictionary are enforced.
--执行跨行级别检查,强制执行验证字典中行的逻辑约束。
3)Performs an object relationship check,which verifies that parent-child relationships between dictionary objects are enforced.
--执行对象关系检查,强制执行验证字典对象之间的父子关系。

涉及到的字典:

The Dictionary Integrity Check operates on the following dictionary objects:
tab$,clu$,fet$,uet$,seg$,undo$,ts$,file$,obj$,ind$,icol$,col$,user$,con$,cdef$,ccol$,bootstrap$,objauth$,ugroup$,tsq$,syn$,view$,typed_view$,superobj$,seq$,lob$,coltype$,subcoltype$,ntab$,refcon$,opqtype$,dependency$,access$,viewcon$,icoldep$,dual$,sysauth$,objpriv$,defrole$,and ecol$.

手动运行健康检查

需要用到DBMS_HM.RUN_CHECK包:

https://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_hm.htm#ARPLS144

DBMS_HM.RUN_CHECK (
   check_name     IN  VARCHAR2,-->  要调用的检查的名称,从V$HM_CHECK和V$HM_CHECK_PARAM视图查看,SELECT name FROM V$HM_CHECK WHERE INTERNAL_CHECK = ‘N‘检索可由用户手动运行的检查列表  ;   
   run_name       IN  VARCHAR2 := NULL,-->运行检查的名称,可不指定。
   timeout        IN  NUMBER := NULL,-->运行的最长时间(以秒为单位),可不指定。
   input_params   IN  VARCHAR2 := NULL); 
                  -->由名称,值对组成,由特殊字符‘;‘分割。具体值通过v$hm_check_param ,v$hm_check视图确定。

1)运行DBMS_HM.RUN_CHECK

BEGIN
   DBMS_HM.RUN_CHECK(‘Dictionary Integrity Check‘,‘Dict_Check‘);
 END;
 /

用法参考:https://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_hm.htm#ARPLS66419

2)SQLPLUS中查看报告

SQL> SET LONG 100000
SQL> SET LONGCHUNKSIZE 1000
SQL> SET PAGESIZE 1000
SQL> SET LINESIZE 512
SQL> SELECT DBMS_HM.GET_RUN_REPORT(‘Dict_Check‘) FROM DUAL;

DBMS_HM.GET_RUN_REPORT(‘DICTCHECK‘)
---------------------------------------------------------
Basic Run Information
 Run Name                     : Dict Check
 Run Id                       : 55001
 Check Name                   : Dictionary Integrity Check
 Mode                         : MANUAL
 Status                       : COMPLETED
 Start Time                   : 2019-07-03 09:49:44.365864 +08:00
 End Time                     : 2019-07-03 09:50:04.668621 +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
v
Run Findings And Recommendations
 Finding
 Finding Name  : Dictionary Inconsistency
 Finding ID    : 55002
 Type          : FAILURE
 Status        : OPEN
 Priority      : CRITICAL
 Message       : SQL dictionary health check: analyzetime for object new than
               sysdate 12 on object TAB$ failed
 Message       : Damaged rowid is AAAAACAABAAAACRAAC - description: Object
               SYS.UNDO$ is referenced
 Finding
 Finding Name  : Dictionary Inconsistency
 Finding ID    : 55005
 Type          : FAILURE
 Status        : OPEN
 Priority      : CRITICAL
 Message       : SQL dictionary health check: analyzetime for object new than
               sysdate 12 on object TAB$ failed
 Message       : Damaged rowid is AAAAACAABAAAACVAAA - description: Object
               SYS.SEQ$ is referenced

3)adrci中查看报告

ADRCI: Release 11.2.0.4.0 - Production on Wed Jul 3 09:52:43 2019

Copyright (c) 1982,2011,Oracle and/or its affiliates.  All rights reserved.

ADR base = "/u01/app/oracle"
adrci> show hm_run

ADR Home = /u01/app/oracle/diag/tnslsnr/prodb/listener:
*************************************************************************
...
**********************************************************
HM RUN RECORD 130
**********************************************************
   RUN_ID                        56581
   RUN_NAME                      Dict_Check
   CHECK_NAME                    Dictionary Integrity Check
   NAME_ID                       24
   MODE                          0
   START_TIME                    2019-07-03 09:58:40.350313 +08:00
   RESUME_TIME                   <NULL>
   END_TIME                      2019-07-03 09:58:56.425829 +08:00
   MODIFIED_TIME                 2019-07-03 09:58:56.425829 +08:00
   TIMEOUT                       0
   FLAGS                         0
   STATUS                        5
   SRC_INCIDENT_ID               0
   NUM_INCIDENTS                 0
   ERR_NUMBER                    0
   REPORT_FILE                   <NULL>

adrci> create report hm_run Dict_Check
adrci> show report hm_run Dict_Check
...
adrci> show hm_run
**********************************************************
HM RUN RECORD 130
**********************************************************
   RUN_ID                        56581
   RUN_NAME                      Dict_Check
   CHECK_NAME                    Dictionary Integrity Check
   NAME_ID                       24
   MODE                          0
   START_TIME                    2019-07-03 09:58:40.350313 +08:00
   RESUME_TIME                   <NULL>
   END_TIME                      2019-07-03 09:58:56.425829 +08:00
   MODIFIED_TIME                 2019-07-03 09:59:40.845354 +08:00
   TIMEOUT                       0
   FLAGS                         0
   STATUS                        5
   SRC_INCIDENT_ID               0
   NUM_INCIDENTS                 0
   ERR_NUMBER                    0
   REPORT_FILE                   /u01/app/oracle/diag/rdbms/PROD/PROD/hm/HMREPORT_Dict_Check.hm

   已生成REPORT_FILE,xml格式。

其他:

(编辑:核心网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读