Table statistics check


Job details

Name: Table statistics check
Platform: Oracle
Category: Maintenance
Description: Reacts on old (or missing) statistics in DBA_TABLES dictionary table (column LAST_ANALYZED).
Long description: Reacts on old (or missing) statistics in DBA_TABLES dictionary table (column LAST_ANALYZED).
Version: 1.6
Default schedule: 10 7 * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘oracle’]/.[ten_and_above=‘1′ & hasengine=‘YES’]

Parameters

Name Default value Description
ignore schemas SYS,SYSMAN,dbwatch,system,DBSNMP,olapsys Schemas excluded from being checked for table statistics (coma separated).
return status when missing statistics 1 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when missing statistics.
return status when old statistics 2 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when old statistics.
last analyzed threshold 14 Expire time in days (LAST_ANALYZED column in DBA_TABLES dictionary view).

Job Summary

SELECT owner AS "Schema", TO_NUMBER(TO_CHAR(LAST_ANALYZED, 'yyyymmdd')) AS "Day Analyzed", COUNT(*) AS "Tables Analyzed"
FROM dba_tables
WHERE (LAST_ANALYZED < SYSDATE - :threshold OR LAST_ANALYZED IS NULL)
AND owner NOT IN (SELECT sch_name FROM dbw_excl_schemas)
GROUP BY owner, TO_NUMBER(TO_CHAR(LAST_ANALYZED, 'yyyymmdd'))
ORDER BY 2 ASC;

Detailed Operation Description

Implementation Details

Reporting Capabilities

“Table statistics check” reports are generated to provide a snapshot of the current statistics status. The primary elements of the report include:

Schema Day Analyzed Tables Analyzed
owner number representing date (yyyymmdd) count

Reports are set to auto-refresh as per the defined schedule in the monitoring job configuration.

Dependencies and Post-Installation