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...
- 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
- 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:
- activities
- blogs
- communities
- dogear
- files
- homepage
- profiles
- wikis
To gather statistics about the Communities discussion forum database, copy the runstats_forum.sql file from the communities subdirectory.
- Log into the database server using an ID that has administrative privileges.
- Take the database offline.
- Open a command prompt, and change to the to which you copied the script.
- Run the script:
db2 -tvf runstats.sqlTo run the script for the Communities discussion forum database...
db2 -tvf runstats_forum.sql
- Bring the database back online.