Home

 

Gathering DB2 database statistics daily

Use the provided script to gather statistics about DB2 database table usage. Run the scripts nightly using the DB2 Task Center, for example, to update internal statistics used by DB2. Up-to-date statistics are necessary for proper performance. This procedure is relevant for DB2 databases only. Oracle and SQL Server gather statistics automatically.


To gather DB2 database statistics...

  1. Copy the statistics script named runstats.sql to the root of the feature database for which you want to gather statistics. The script is stored in the following subdirectory of the Lotus Connections installation files:

    • AIX or Linux

        /Lotus_Connections_Install/connections.sql/
         <feature_subdirectory>/db2
        

  2. Microsoft Windows

      \Lotus_Connections_Install\connections.sql\
       <feature_subdirectory>\db2
      

    where <feature_subdirectory> is the script file storage of the feature for which you are compacting the database. Choose one of the following subdirectories:

    To gather statistics about the Communities discussion forum database, copy the runstats_forum.sql file from the communities subdirectory.

  3. Log into the database server using an ID that has administrative privileges.

  4. Take the database offline.

  5. Open a command prompt, and change to the to which you copied the script.

  6. Run the script:

      db2 -tvf runstats.sql 
      

    To run the script for the Communities discussion forum database...

      db2 -tvf runstats_forum.sql 
      

  7. Bring the database back online.


Maintaining feature databases


+

Search Tips   |   Advanced Search