Gather DB2 database statistics daily
Use the scripts provided with Connections to gather statistics about DB2 database usage.
Up-to-date statistics are necessary for optimal performance. We can collect statistics while IBM Connections is running. However, it is better to schedule collection during off-peak hours by using a tool such as DB2 Task Scheduler.
This procedure is relevant for DB2 databases only. Oracle and SQL Server databases gather statistics automatically.
To gather DB2 database statistics:
- Copy the statistics script named runstats.sql to the root directory of the application database for which to gather statistics. The script is stored in...
- AIX or Linux:/Lotus_Connections_Install/connections.sql/ application/db2
- IBM i:/Lotus_Connections_Install/connections.sql/application/db2
- Windows:\Lotus_Connections_Install\connections.sql\ application\db2
where application is the script file storage directory of the application for which we are compacting the database. Choose one of the following subdirectories:
- activities
- blogs
- communities
- dogear
- files
- forum
- homepage
- metrics
- profiles
- wikis
- Log into the database server with an ID that has administrative privileges.
- Open a command prompt and then change to the directory to which you copied the script.
- Run the application scripts:
- For Activities, Blogs, Communities, and Forums: db2 -td@ -vf runstats.sql
- For Bookmarks and Profiles: db2 -tvf runstats.sql
- For Home page: db2 -tvf updateStats.sql
- For Files, Metrics, and Wikis: db2 -td@ -vf updateStats.sql
Parent topic:
Maintain application databases