Migrating statistics by using the HSTATS command
To migrate statistics, follow these steps:
- Extract the statistics from the source Db2 subsystem. This process creates a script containing the 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, BMC AMI Command Center does not verify whether the objects exist in the target environment. If the objects do not exist, the transfer process receives the following message: The following row not found for update.
Before you begin
Make sure that you have the appropriate authorities to access the Db2 catalog.
To migrate statistics by using the HSTATS command
- Select the DB2 Navigator perspective.
- Open or create an object view.
Select one or more objects from the database, table space, table, or index list.
Select Commands > HSTATS.
In the Scratchpad perspective, BMC AMI Command Center displays SQL commands for the extracted statistics.
- Update the object names as needed.
- To save the extracted statistics, follow these steps:
- On the toolbar, click Save file
.
- Select a z/OS data set in which to save the file.
- Click Add filter
.
- In the Filter Pattern box, enter a filter (the wildcard * is supported) to display a filtered list of data sets that include the one that you want.
- Click OK.
- In the displayed hierarchical tree, navigate to and select the data set that you want.If you select an archived data set, when prompted confirm that you want to restore that data set.
- Click Add filter
- Enter a file name.
- Click Save.
- On the toolbar, click Save file
- To transfer statistics to another Db2 database or subsystem, follow these steps:
- On the toolbar, click Run
.
- In the Run Commands dialog box, select the DB2 Connection to which you want to transfer the statistics.
- Click OK.
- On the toolbar, click Run
Statistics migration updates the following Db2 statistics tables:
- SYSTABLESPACE
- SYSTABLES
- SYSCOLUMNS
- SYSCOLSTATS
- SYSCOLDIST
- SYSTABSTATS
- SYSINDEXES
- SYSKEYTARGETS
- SYSKEYTARGETSTATS
- SYSKEYTGTDIST
- SYSKEYTGTDISTSTATS
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*