Gathering statistics with the COPY RUNSTATS option


The RUNSTATS option on the COPY command allows you to gather table space level statistics and update the Db2 catalog.

These statistics can be used to determine when to take table space level actions such as reorganizations. Statistics are also used by the Db2 optimizer for access path selection. Thus,

Some content is unavailable due to permissions.

allows you to accomplish two tasks--making an image copy and gathering statistics--with one pass of the data. This capability provides significant performance and resource savings over running a COPY utility and a RUNSTATS utility separately and is unique to

Some content is unavailable due to permissions.

. For more information, see RUNSTATS and Reducing elapsed time.

BMCSTATS can also be updated if you have DASD MANAGER PLUS.

Set the INVCACHE option (OPTIONS-syntax-option-description and INVCACHE=NO) to YES if you need to have the dynamic SQL cache invalidated after the statistics are updated. Using INVCACHE=YES will cause the Db2 optimizer to pick up the new information the next time the SQL statement is executed.

Important

RUNSTATS is not valid for spaces in REORP status.

For information about real-time statistics, see Supporting-real-time-statistics-in-BMC-AMI-Copy.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*