Migrating statistics
You can use the HSTATS command to copy statistics from one Db2 catalog to another, or to the same subsystem’s Db2 catalog. 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. This example assumes that your Db2 environments are the same—that buffer pools, EDM pools, and so on are of comparable sizes in both environments. You can preserve the test data and still see the access paths based on production data.
Extract the statistics from the source Db2 subsystem. This process creates a script containing the access path statistics to update on the target Db2 catalog.
- (Optional) Update extracted statistics.
Transfer statistics into the target Db2 subsystem (SSID).
Because of the method used to extract the statistics, Catalog Manager does not verify whether the objects exist in the target environment. If the objects do not exist, the Transfer job receives the following message: The following row not found for update
.
Before you begin
Make sure that the user administering the Extract or the Transfer jobs has the appropriate authorities to access the Db2 catalog.
To migrate statistics
- To migrate statistics to a different Db2 subsystem, perform one of the following procedures:
If you are using (BMC.DB2.SPE2210) or later, perform the following steps:- In the Execute SQL field, type Y to execute the SQL displayed on the Confirm SQL panel and then press Enter.
The SQL Progress Indicator panel is displayed. The panel automatically refreshes to display the status of the SQL that is being executed. Press End.
- In the Execute SQL field, type Y to execute the SQL displayed on the Confirm SQL panel and then press Enter.
Comments
Log in or register to comment.