Tuning DB2 for a Sametime Advanced Server

IBM® DB2® is a database management system that stores information used by IBM Sametime® Advanced. A database that has the potential to grow large requires some ongoing tuning by a database administrator.

About this task

Periodically, as the dataset grows, the database administrator should reorganize the objects that need attention, and update the statistics so that the DB2 optimizer can make optimal plans for accessing the data. Sametime Advanced provides an example script that reorganizes the indexes that are most likely to require attention and then updates the statistics in the catalog. The script is called stadv_reorg.sql and is stored in the STAdvancedLaunchpad\disk1\DatabaseScripts directory within the Sametime software download. This script or one like it should be run periodically when the system is lightly loaded, as it will lock the tables as it runs.

Procedure

Follow these steps to reorganize the indexes by running a version of the stadv_stadv_reorg.sql script that you have customized for your site.
  1. On the DB2 server, log in with the database administrator account.
  2. Open a DB2 command window.
  3. From the command line, enter

    db2

  4. Enter the command to connect to the Sametime Advanced database

    connect to advanced_database_name

    where advanced_database_name is the name of the Sametime Advanced database.

  5. Run the script with the following command:

    db2 -tf stadv_reorg.sql

  6. Enter the following commands to update relevant tables and columns in the database:
    update sysstat.tables set card=100000,npages=10000,fpages=15000 where tabname = 'USER_CONNECTION';
    update sysstat.tables set card=100000,npages=10000,fpages=15000 where tabname = 'COMMUNITY_SUBSCRIPTION';
    update sysstat.columns set colcard = 50000 where tabname = 'USER_CONNECTION' and colname = 'MEMBERID';
    update sysstat.columns set colcard = 5 where tabname = 'USER_CONNECTION' and colname = 'NODEID';
    update sysstat.columns set colcard = 50000 where tabname = 'COMMUNITY_SUBSCRIPTION' and colname = 'CLIENTID';
    update sysstat.columns set colcard = 50000 where tabname = 'COMMUNITY_SUBSCRIPTION' and colname = 'TOPIC';
    commit;