Optimizing the performance of your DB2 database
To optimize the DB2® database performance, you can use the RUNSTATS, REORG, and REBIND utilities after you complete the installation or upgrade of WSRR.
Procedure
To optimize the performance of your DB2 database, complete the following steps:
- Open a DB2 command window.
- Connect to your WSRR database by entering the following
command:
where:db2 connect to db_name user username using password- db_name is the name of your WSRR database; the default name is WSRRDB.
- username is the user ID used to access the WSRR database.
- password is the password for the user ID used to access the WSRR database.
- Enter the following commands (enter each
db2 reorg command on one line):
where db_schema is the name of your database schema.db2 reorg indexes all for table db_schema.gstatement db2 reorg indexes all for table db_schema.statement db2 reorg indexes all for table db_schema.subject db2 reorg indexes all for table db_schema.predicate db2 reorg indexes all for table db_schema.object db2 reorg indexes all for table db_schema.graphYou can also run reorg on the following tables (this is optional, but might further improve performance):db2 reorg table db_schema.cre_large_cdata db2 reorg table db_schema.cre_page db2 reorg table db_schema.cre_state_item db2 reorg table db_schema.cre_state_set db2 reorg table db_schema.cre_widget_instance db2 reorg table db_schema.cre_widget_instance_cre_wire db2 reorg table db_schema.cre_wire db2 reorg table db_schema.defaultperm db2 reorg table db_schema.uiuser db2 reorg table db_schema.uiuserstorage db2 reorg table db_schema.sr_analytics db2 reorg table db_schema.sr_assertion db2 reorg table db_schema.sr_associated db2 reorg table db_schema.sr_entityaction db2 reorg table db_schema.sr_valdtrpolicy db2 reorg table db_schema.sr_wmb_policy db2 reorg table db_act_schema.sr_activity_apicall db2 reorg table db_act_schema.sr_activity_record - Enter the following commands (enter each db2 runstats command on one line):
where db_schema is the name of your database schema.db2 runstats on table db_schema.gstatement with distribution default num_freqvalues 500 and detailed indexes all db2 runstats on table db_schema.statement with distribution default num_freqvalues 500 and detailed indexes all db2 runstats on table db_schema.subject with distribution default num_freqvalues 500 and detailed indexes all db2 runstats on table db_schema.predicate with distribution default num_freqvalues 500 and detailed indexes all db2 runstats on table db_schema.object with distribution default num_freqvalues 500 and detailed indexes all db2 runstats on table db_schema.graph with distribution and detailed indexes allYou can also run runstats on the following tables (this is optional, but might further improve performance):db2 runstats on table db_schema.cre_large_cdata and indexes all db2 runstats on table db_schema.cre_page with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.cre_state_item with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.cre_state_set with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.cre_widget_instance with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.cre_widget_instance_cre_wire with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.cre_wire with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.defaultperm and indexes all db2 runstats on table db_schema.uiuser with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.uiuserstorage with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.sr_analytics with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.sr_assertion with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.sr_associated with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.sr_entityaction with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.sr_valdtrpolicy with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_schema.sr_wmb_policy with distribution default num_freqvalues 20 and indexes all db2 runstats on table db_act_schema.sr_activity_apicall and indexes all db2 runstats on table db_act_schema.sr_activity_record and indexes all - Enter the following command.
where:db2rbind db_name -l log_filename all -u username -p password- db_name is the name of your WSRR database; the default name is WSRRDB.
- log_filename is the name of the log file.
- username is the user ID used to access the WSRR database.
- password is the password for the user ID used to access the WSRR database.
- Close the DB2 command
window. Note: If you do not run this process, it can cause a serious degradation of performance in some cases.Note: Repeat this task if there any large changes to your data content; for example, if you do either of the following tasks:
- Activate a different configuration profile.
- Import data into your registry.
