9.7 Running Health Checks with Health Monitor

«« Previous
Next »»

You can run diagnostic checks on a database with Health Monitor.

  • About Health Monitor

Oracle Database includes a framework called Health Monitor for running diagnostic checks on the database.
    • About Health Monitor Checks
Health Monitor checks (also known as checkers, health checks, or checks) examine various layers and components of the database.

Health checks detect file corruptions, physical and logical block corruptions, undo and redo corruptions, data dictionary corruptions, and more. The health checks generate reports of their findings and, in many cases, recommendations for resolving problems. Health checks can be run in two ways:

1. Reactive—The fault diagnosability infrastructure can run health checks automatically in response to a critical error.

2. Manual—As a DBA, you can manually run health checks using either the DBMS_HM PL/SQL package or the Cloud Control interface. You can run checkers on a regular basis if desired, or Oracle Support may ask you to run a checker while working with you on a service request.

Health Monitor checks store findings, recommendations, and other information in the Automatic Diagnostic Repository (ADR).

Health checks can run in two modes:

1. DB-online mode means the check can be run while the database is open (that is, in OPEN mode or MOUNT mode).

2. DB-offline mode means the check can be run when the instance is available but the database itself is closed (that is, in NOMOUNT mode).

All the health checks can be run in DB-online mode. Only the Redo Integrity Check and the DB Structure Integrity Check can be used in DB-offline mode.
    • Types of Health Checks
Health monitor runs several different types of checks.

Health monitor runs the following checks:
  1. DB Structure Integrity Check—This check verifies the integrity of database files and reports failures if these files are inaccessible, corrupt or inconsistent. If the database is in mount or open mode, this check examines the log files and data files listed in the control file. If the database is in NOMOUNT mode, only the control file is checked.
  2. Data Block Integrity Check—This check detects disk image block corruptions such as checksum failures, head/tail mismatch, and logical inconsistencies within the block. Most corruptions can be repaired using Block Media Recovery. Corrupted block information is also captured in the V$DATABASE_BLOCK_CORRUPTION view. This check does not detect inter-block or inter-segment corruption.
  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.
  5. Transaction Integrity Check—This check is identical to the Undo Segment Integrity Check except that it checks only one specific transaction.
  6. Dictionary Integrity Check—This check examines the integrity of core dictionary objects, such as tab$ and col$. It performs the following operations:
    • Verifies the contents of dictionary entries for each dictionary object.
    • Performs a cross-row level check, which verifies that logical constraints on rows in the dictionary are enforced.
    • 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$.

  • Running Health Checks Manually

Health Monitor can run health checks manually either by using the DBMS_HM PL/SQL package or by using the Cloud Control interface, found on the Checkers subpage of the Advisor Central page.
    • Running Health Checks Using the DBMS_HM PL/SQL Package
The DBMS_HM procedure for running a health check is called RUN_CHECK.

1. To call RUN_CHECK, supply the name of the check and a name for the run, as follows:

  DBMS_HM.RUN_CHECK('Dictionary Integrity Check', 'my_run');

2. To obtain a list of health check names, run the following query:

SELECT name FROM v$hm_check WHERE internal_check='N';

Your output is similar to the following:

DB Structure Integrity Check
Data Block Integrity Check
Redo Integrity Check
Transaction Integrity Check
Undo Segment Integrity Check
Dictionary Integrity Check

Most health checks accept input parameters. You can view parameter names and descriptions with the V$HM_CHECK_PARAM view. Some parameters are mandatory while others are optional. If optional parameters are omitted, defaults are used. The following query displays parameter information for all health checks:

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;

Input parameters are passed in the input_params argument as name/value pairs separated by semicolons (;). The following example illustrates how to pass the transaction ID as a parameter to the Transaction Integrity Check:

   check_name   => 'Transaction Integrity Check',
   run_name     => 'my_run',
   input_params => 'TXN_ID=7.33.2');
    • Running Health Checks Using Cloud Control
Cloud Control provides an interface for running Health Monitor checkers.

To run a Health Monitor Checker using Cloud Control:

1. Access the Database Home page.
2. From the Performance menu, select Advisors Home.
3. Click Checkers to view the Checkers subpage.
4. In the Checkers section, click the checker you want to run.
5. Enter values for input parameters or, for optional parameters, leave them blank to accept the defaults.
6. Click OK, confirm your parameters, and click OK again.

  • Viewing Checker Reports

After a checker has run, you can view a report of its execution. The report contains findings, recommendations, and other information. You can view reports using Cloud Control, the ADRCI utility, or the DBMS_HM PL/SQL package. The following table indicates the report formats available with each viewing method.
    • About Viewing Checker Reports
Report Viewing Method Report Formats Available
Cloud Control HTML
DBMS_HM PL/SQL package HTML, XML, and text
ADRCI utility XML

When you request a report with the DBMS_HM PL/SQL package or with Cloud Control, if the report does not yet exist, it is first generated from the checker run data in the ADR, stored as a report file in XML format in the HM subdirectory of the ADR home for the current instance, and then displayed. If the report file already exists, it is just displayed. When using the ADRCI utility, you must first run a command to generate the report file if it does not exist, and then run another command to display its contents.

The preferred method to view checker reports is with Cloud Control.
    • Viewing Reports Using Cloud Control
You can also view Health Monitor reports and findings for a given checker run using Cloud Control.

To view run findings using Cloud Control:

1. Access the Database Home page.
2. From the Performance menu, select Advisors Home.
3. Click Checkers to view the Checkers subpage.
4. Click the run name for the checker run that you want to view.
The Run Detail page appears, showing the Findings subpage for that checker run.

5. Click Runs to display the Runs subpage.
Cloud Control displays more information about the checker run.

6. Click View Report to view the report for the checker run.
The report is displayed in a new browser window.
    • Viewing Reports Using DBMS_HM
You can view Health Monitor checker reports with the DBMS_HM package function GET_RUN_REPORT.

This function enables you to request HTML, XML, or text formatting. The default format is text, as shown in the following SQL*Plus example:

SET LONG 100000

 Run Name : HM_RUN_1061
 Run Id : 1061
 Check Name : Data Block Integrity Check
 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 Parameters for the Run
Run Findings And Recommendations
 Finding Name : Media Block Corruption
 Finding ID  : 1065
 Status : OPEN
 Priority : HIGH
 Message   : Block 64349 in datafile 1:
               '/u01/app/oracle/dbs/t_db1.f' is media corrupt
 Message : Object BMRTEST1 owned by SYS might be unavailable
 Finding Name : Media Block Corruption
 Finding ID : 1071
 Status  : OPEN
 Priority : HIGH
 Message : Block 64351 in datafile 1:
               '/u01/app/oracle/dbs/t_db1.f' is media corrupt
 Message       : Object BMRTEST2 owned by SYS might be unavailable
    • Viewing Reports Using the ADRCI Utility
You can create and view Health Monitor checker reports using the ADRCI utility.

To create and view a checker report using ADRCI:

1. Ensure that operating system environment variables (such as ORACLE_HOME) are set properly, and then enter the following command at the operating system command prompt:


The utility starts and displays the following prompt:


Optionally, you can change the current ADR home. Use the SHOW HOMES command to list all ADR homes, and the SET HOMEPATH command to change the current ADR home.

2. Enter the following command:
show hm_run

This command lists all the checker runs (stored in V$HM_RUN) registered in the ADR repository.

3. Locate the checker run for which you want to create a report and note the checker run name. The REPORT_FILE field contains a file name if a report already exists for this checker run. Otherwise, generate the report with the following command:

create report hm_run run_name

4. To view the report, enter the following command:

show report hm_run run_name

  • Health Monitor Views

Instead of requesting a checker report, you can view the results of a specific checker run by directly querying the ADR data from which reports are created.

This data is available through the views V$HM_RUN, V$HM_FINDING, and V$HM_RECOMMENDATION.

The following example queries the V$HM_RUN view to determine a history of checker runs:

SELECT run_id, name, check_name, run_mode, src_incident FROM v$hm_run;

---------- ------------ ---------------------------------- -------- ------------
         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

The next example queries the V$HM_FINDING view to obtain finding details for the reactive data block check with RUN_ID 1061:

SELECT type, description FROM v$hm_finding WHERE run_id = 1061;

------------- -----------------------------------------
FAILURE       Block 64349 in datafile 1: '/u01/app/orac
                       le/dbs/t_db1.f' is media corrupt
FAILURE       Block 64351 in datafile 1: '/u01/app/orac
                       le/dbs/t_db1.f' is media corrupt
  • Health Check Parameters Reference
Some health checks require parameters. Parameters with a default value of (none) are mandatory.

Table 9-6 Parameters for Data Block Integrity Check

Parameter Name Type Default Value Description
BLC_DF_NUM Number (none) Block data file number
BLC_BL_NUM Number (none) Data block number

Table 9-7 Parameters for Redo Integrity Check

Parameter NameTypeDefault ValueDescription
SCN_TEXTText0SCN of the latest good redo (if known)

Table 9-8 Parameters for Undo Segment Integrity Check

Parameter NameTypeDefault ValueDescription
USN_NUMBERText(none)Undo segment number

Table 9-9 Parameters for Transaction Integrity Check

Parameter NameTypeDefault ValueDescription
TXN_IDText(none)Transaction ID

Table 9-10 Parameters for Dictionary Integrity Check

Parameter NameType Default ValueDescription
CHECK_MASKTextALLPossible 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_NAMETextALL_CORE_TABLESName of a single core table to check. If omitted, all core tables are checked.

«« Previous
Next »»