-- note that the directory {ORACLE_BASE}/diag/rdbms/<database_name>/<instance_name>/hm on a lab server
-- the directory created is /app/oracle/diag/rdbms/orabase/orabase/hm.
Runs the specified checker with the given arguments. The run's report will be maintained persistently in database.
And a big thank you to Earl Apex for a correction.
dbms_hm.run_check(
check_name IN VARCHAR2,
run_name IN VARCHAR2 := NULL,
timeout IN NUMBER := NULL,
input_params IN VARCHAR2 := NULL);
Checkers
ASM Allocation Check
CF Block Integrity Check
DB Structure Integrity Check
Data Block Integrity Check
Dictionary Integrity Check
Redo Integrity Check
Transaction Integrity Check
Undo Segment Integrity Check
--
Check names and their parameters can be accessed from the gv$hm_check and
-- gv$hm_check_param. Users can run all checks not internal in nature for example:
SELECT name
FROM gv$hm_check
WHERE internal_check = 'N';
-- which retrieves the list of checks that can be run manually by users.
SELECT name FROM gv$hm_check;
SELECT name FROM gv$hm_check
WHERE internal_check = 'N';
Runs a DDE (user) action for HM checks ... appears to be intended solely for internal use
dbms_hm.run_dde_action(
incident_id IN NUMBER,
directory_name IN VARCHAR2,
check_name IN VARCHAR2,
run_name IN VARCHAR2,
timeout IN NUMBER,
params IN VARCHAR2)
RETURN BOOLEAN;
col check_name format a35
SELECT run_id, num_incident, check_name, name, timeout
FROM gv$hm_run
WHERE start_time > SYSTIMESTAMP-95
ORDER BY 1;
DECLARE
retVal BOOLEAN;
BEGIN
IF dbms_hm.run_dde_action(1, 'CTEMP', 'DB Structure Integrity Check', 'UWRUN', 10, NULL) THEN
dbms_output.put_line('T');
ELSE
dbms_output.put_line('F');
END IF;
END;
/ T
PL/SQL procedure successfully completed.
Related Queries
DBMS_HM Related Queries
set linesize 125
col check_name format a30
col parameter_name format a18
col type format a15
col default_value format a15
col description format a40
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;
CHECK_NAME PARAMETER_NAME TYPE DEFAULT_VALUE DESCRIPTION
------------------------ -------------- --------------- --------------- ------------------
ASM Allocation Check ASM_DISK_GRP_NAME DBKH_PARAM_TEXT ASM group name
CF Block Integrity Check CF_BL_NUM DBKH_PARAM_UB4 Control file block number
Data Block Integrity Check BLC_DF_NUM DBKH_PARAM_UB4 File number
Data Block Integrity Check BLC_BL_NUM DBKH_PARAM_UB4 Block number
Dictionary Integrity Check CHECK_MASK DBKH_PARAM_TEXT ALL Check mask
Dictionary Integrity Check TABLE_NAME DBKH_PARAM_TEXT ALL_CORE_TABLES Table name
Redo Integrity Check SCN_TEXT DBKH_PARAM_TEXT 0 SCN of the latest good redo (if known)
Transaction Integrity Check TXN_ID DBKH_PARAM_TEXT Transaction ID
Undo Segment Integrity Check USN_NUMBER DBKH_PARAM_TEXT Undo segment number