Table fragmentation


Job details

Name: Table fragmentation
Platform: Oracle
Category: Maintenance
Premium package: Maintenance package
Description: Checks the Table fragmentation in all database schemas.
Long description: Checks the table fragmentation in all database schemas.
Version: 1.2
Default schedule: 40 4 5 *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘oracle’]/.[hasengine=‘YES’ & maj_version=‘10′]

Parameters

Name Default value Description
history threshold 90 The number of days the statistics (size, rows count, fragmentation, etc.) will be kept in the history table.
max objects 10 The number of tables for which the statistics will be collected into the history table.
size threshold 50 The minimum size (in MB) of the table to be analyzed for fragmentation.
max elapsed time 60 The maximum time (in minutes) the procedure is allowed to run.
warning threshold 50 Warning threshold value in percent. If the average blocks density (in percent) in the table get below the threshold value, the job will return a warning.
alarm threshold 30 Alarm threshold value in percent. If the average blocks density (in percent) in the table get below the threshold value, the job will return an alarm.
ignore schemas SYS, SYSTEM List of schemas (separated by comma) which will be ignored. You can use % (percent sign) to represent wild card characters.
enable warnings and alarms NO If set to “NO” (default), the job will only collect statistics without returning status warning or alarm. Value “YES“ will activate alerting.
continue on next run YES If set to “YES“ (default) the procedure will continue where it left off.
max objects per graph 5 The maximum number of objects visualized in the report graphs.
max objects per table 30 The maximum number of objects visualized in the report table.
check empty blocks NO Checks the number of empty (never used) data blocks in the table (column EMPTY_BLOCKS in DBA_TABLES). This column is populated only if you collect statistics on the table using the DBMS_STATS package. If set to “YES“ the procedure will execute DBMS_STATS.proc_name procedure on a table with missing statistics.
density threshold 80 Tables with higher density then this parameter value are not checked.

Job Summary

SELECT owner, table_name, blocks, empty_blocks, avg_space, chain_cnt, avg_row_len, num_rows FROM dba_tables WHERE table_name = 'your_table_name';

Job Dependencies

The task has dependencies on several elements necessary for its operation:

Operation Details

This job performs several functions as described below:

Automatic Execution Setup

This task is scheduled to run periodically with the default schedule set to run at a specific hour and minute, ensuring regular checks and updates on the state of table fragmentation across the database.

Reporting

Upon execution, the job provides detailed reports which include:

Schema Count Table Count Min Size Threshold (MB) Density Threshold Min Density Schemas Checked Tables Checked Fragmentation Table Count
Objects Checked Size (MB) Start End Elapsed Time (sec.) Elapsed Time (min.) Last Schema Last Table Errors

In addition, visual graphs and tabulated data present the fragmentation statistics and history in a way that’s easy to understand and analyze for database administrators.