文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Oracle 健康监控器(Health Monitor)

2024-04-02 19:55

关注

健康监控器(Health Monitor)
ORACLE 11G 中引入了免费的数据库健康监控器,通过DBMS_HM程序包来完成。

检查项目:
1.DB结构完整性检查

2.数据块及完整性检查

3.中做日志完整性检查

4.Undo段完整性检查

5.事物完整性检查

6.数据字典完整性检查

SQL> select name,description from v$hm_check;
NAME                           DESCRIPTION
------------------------------ -------------------------------------------------
HM Test Check                  Check for HM Functionality
DB Structure Integrity Check   Checks integrity of all database files
Data Block Integrity Check     Checks integrity of a datafile block
Redo Integrity Check           Checks integrity of redo log content
Logical Block Check            Checks logical content of a block
Transaction Integrity Check    Checks a transaction for corruptions
Undo Segment Integrity Check   Checks integrity of an undo segment
All Control Files Check        Checks all control files in the database
CF Member Check                Checks a multiplexed copy of the control file
All Datafiles Check            Check for all datafiles in the database
NAME                           DESCRIPTION
------------------------------ -------------------------------------------------
Single Datafile Check          Checks a datafile
Log Group Check                Checks all members of a log group
Log Group Member Check         Checks a particular member of a log group
Archived Log Check             Checks an archived log
Redo Revalidation Check        Checks redo log content
IO Revalidation Check          Checks file accessability
Block IO Revalidation Check    Checks file accessability
Txn Revalidation Check         Revalidate corrupted txn
Failure Simulation Check       Creates dummy failures
Dictionary Integrity Check     Checks dictionary integrity
21 rows selected.



PROCEDURE RUN_CHECK
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 CHECK_NAME                     VARCHAR2                IN
 RUN_NAME                       VARCHAR2                IN     DEFAULT
 TIMEOUT                        NUMBER                  IN     DEFAULT
 INPUT_PARAMS                   VARCHAR2                IN     DEFAULT
 
 
 
.check_name:数据库检查名,这是一个强制参数必须被指定。可以在视图v$hm_check中查询到该参数的值。共21个值。
.run_name:可选参数,指定一个检查名。
.timeout:可选参数,可以设置老化时间。
.params:输入参数,用于控制检查的执行。可以在视图v$hm_check_param视图中查看。
以下是一个检查的例子:
SQL>exec dbms_hm.run_check('Dictionary Integrity Check','HM_TEST');


这个健康检查会存储报告到ADR数据库实例的home目录中。通过adrci的show hm_run命令可以显示这些信息:
adrci> show hm_run


.......
**********************************************************
HM RUN RECORD 2766
**********************************************************
   RUN_ID                        55361
   RUN_NAME                      HM_RUN_55361
   CHECK_NAME                    DB Structure Integrity Check
   NAME_ID                       2
   MODE                          2
   START_TIME                    2015-09-28 08:58:30.714167 +08:00
   RESUME_TIME                   <NULL>
   END_TIME                      2015-09-28 08:58:30.742168 +08:00
   MODIFIED_TIME                 2015-09-28 08:58:30.742168 +08:00
   TIMEOUT                       0
   FLAGS                         0
   STATUS                        5
   SRC_INCIDENT_ID               0
   NUM_INCIDENTS                 0
   ERR_NUMBER                    0
   REPORT_FILE                   <NULL>

**********************************************************
HM RUN RECORD 2767
**********************************************************
   RUN_ID                        55381
   RUN_NAME                      HM_RUN_55381
   CHECK_NAME                    DB Structure Integrity Check
   NAME_ID                       2
   MODE                          2
   START_TIME                    2015-09-28 08:59:30.209094 +08:00
   RESUME_TIME                   <NULL>
   END_TIME                      2015-09-28 08:59:30.241902 +08:00
   MODIFIED_TIME                 2015-09-28 08:59:30.241902 +08:00
   TIMEOUT                       0
   FLAGS                         0
   STATUS                        5
   SRC_INCIDENT_ID               0
   NUM_INCIDENTS                 0
   ERR_NUMBER                    0
   REPORT_FILE                   <NULL>



adrci> show report hm_run testrun1
DIA-48614: HM run with name [testrun1] not found





网上其他人的例子:
adrci> show report hm_run testrun1
 
Data Block Check
Multiple corrupted blocks
datafile 2 contains corrupt blocks
tablespace SYSAUX is unavailable
block 66578 in datafile 2 is corrupt

adrci>
上面的报告显示数据文件2上有坏块,该文件属于sysaux表空间。
所有的健康检查报告存储在v$hm_run视图中,你也可以通过dbms_hm包来获取报告:
SQL> /

NAME                             CHECK_NAME                       RUN_MODE STATUS
-------------------------------- -------------------------------- -------- -----------
HM_RUN_21                        DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_41                        DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_61                        DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_81                        DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_101                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_121                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_141                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_161                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_181                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_201                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_221                       DB Structure Integrity Check     REACTIVE COMPLETED

NAME                             CHECK_NAME                       RUN_MODE STATUS
-------------------------------- -------------------------------- -------- -----------
HM_RUN_241                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_261                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_281                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_301                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_321                       DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_341                       DB Structure Integrity Check     REACTIVE COMPLETED
.....
HM_RUN_55701                     DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_55721                     DB Structure Integrity Check     REACTIVE COMPLETED

NAME                             CHECK_NAME                       RUN_MODE STATUS
-------------------------------- -------------------------------- -------- -----------
HM_RUN_55741                     DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_55761                     DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_55781                     DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_55801                     DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_55821                     DB Structure Integrity Check     REACTIVE COMPLETED
HM_RUN_55841                     DB Structure Integrity Check     REACTIVE COMPLETED
my_run                           Dictionary Integrity Check       MANUAL   COMPLETED
HM_TEST                          Dictionary Integrity Check       MANUAL   COMPLETED
HM_RUN_1                         DB Structure Integrity Check     REACTIVE COMPLETED


my_run和HM_TEST就是我自己手动调用的。





可以查看刚刚检查的
SQL> set long 100000
SQL> set longchunksize 1000
SQL> set pagesize 1000
SQL> set linesize 512
SQL> select DBMS_HM.GET_RUN_REPORT('HM_TEST') FROM DUAL;

DBMS_HM.GET_RUN_REPORT('HM_TEST')
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Basic Run Information
 Run Name                     : HM_TEST
 Run Id                       : 55901
 Check Name                   : Dictionary Integrity Check
 Mode                         : MANUAL
 Status                       : COMPLETED
 Start Time                   : 2015-10-15 18:17:00.890101 +08:00
 End Time                     : 2015-10-15 18:17:01.349346 +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

    

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯