It improves performance when you run this utility on a selected tableSpace. If you get errors like Reorg-Check pending status then you need this utility to resolve the issue.
“Learning SQL is one of the fastest ways to improve your career prospects as it is one of the most in demand tech skills!”
- Gaps can get created in tablespace containers over the life of a database. So how do you know how much storage space is currently being utilized by data and how much is free, but part of an unusable gap?
- You can obtain this information by taking advantage of DB2 UDB’s REORGCHK utility.
When executed, this utility generates statistics on the database, and analyzes the statistics produced to determine whether or not one or more tables need to be reorganized (which will cause existing internal gaps to be removed).
The REORGCHK utility is invoked by executing the REORGCHK command using the DB2 Command Line Processor. The basic syntax for this command is:
REORGCHK <UPDATE STATISTICS | CURRENT STATISTICS> <ON TABLE USER | ON SCHEMA [SchemaName] | ON TABLE [USER | SYSTEM | ALL | [TableName]>
|SchemaName||Identifies the name assigned to a schema whose objects are to be analyzed to determine whether or not they need to be reorganized.|
|TableName||Identifies the name assigned to a specific table that is to be analyzed to determine whether or not it needs to be reorganized.|
So if you wanted to generate statistics for all tables that reside in the PAY-ROLL schema and have those statistics analyzed to determine whether or not one or more tables needs to be reorganized, you could do so by executing a REORGCHK command that looks something like this:
REORGCHK UPDATE STATISTICS ON SCHEMA PAYROLL