Migrating statistics

You can copy statistics from one Db2 subsystem to another and from one Db2 schema to another in the following ways:

  • Direct access-path statistics migration
  • Statistics migration by using extracting and transferring with the HSTATS command
Related topic

Migrating access-path statistics

You can migrate the access-path statistics for a set of objects from one subsystem to another, or from one schema to another within the same subsystem.

For the selected objects, BMC AMI Command Center migrates the table, table space, and index statistics that affect the access path.

For example, you can migrate production statistics to a test environment to view the actual access paths that the Db2 optimizer selects, without the cost of replicating the production environment.

You can select objects from a Results list in the DB2 Navigator perspective, or select objects included in a SQL Tuning session in the Performance perspective.

You can reuse a saved Migrate Statistics session. In the reused session, you can update objects with current access-path statistics, or change the source or target of the statistics.

You can use the Options  (In the new console, use ) button to set optional behaviors of the statistics migration feature.

For more information, see the following topics:

Migrating statistics with the HSTATS command

(BMC.DB2.SPE2301) Open link

You can use the HSTATS command to extract and transfer either access-path statistics or all statistics. The HSTATS command builds DML statements for statistics which can be used to transfer the statistics to one or more Db2 subsystems or Db2 schema. You can save the DML statements to a file for later use. Using the Scratchpad perspective, you can run the import as many times as needed.

You can use the Options button in the DB2 Navigator perspective to set migration options for the HSTATS command. For more information, see Setting DB2 Navigator options.

For more information, see Migrating statistics by using the HSTATS command.

Was this page helpful? Yes No Submitting... Thank you

Comments