Using nCompact -B to reorganize tables and indices associated with a DB2-enabled Notes database
The IBM® Lotus® Domino® addin task, nCompact -B, performs basic inplace IBM® DB2 Universal Database™ Enterprise Server Edition reorganizations on all tables and indexes associated with the DB2 enabled IBM® Lotus® Notes® database that you specify. The reorganization operation is performed on the entire set of tables that can be shared by multiple DB2-enabled Notes databases. Running nCompact -B against a directory will not perform duplicate/redundant reorganizations; that is, DB2 table and index reorganizations only occur once per table. If Domino is not running, a more aggressive off-line reorganization is performed where an attempt is made to move long data fields and large binary objects (LOBs) while using a temporary SMS tablespace as a scratch pad for temporary data for maximum efficiency.

Note Run nCompact -B with an uppercase B, not a lowercase b.

Running DB2DART/LHWM to obtain reorg options

You can run DB2DART /LHWM on the tablespace containing the DB2 enabled Notes database to obtain details as to what the most efficient DB2 reorg options are for consolidating your data so that the high water mark (HWM) can be lowered. Lowering the HWM allows you to reduce the size of the tablespace from the DB2 Control Center.

To run the command to list tablespaces, as well as other DB2 commands similar to this one, before entering the command you must connect to the first DB2 database that was created. For example, if that DB2 database is named DOMINO, you would enter one of these commands according to whether you need to enter a user name and password:


If you are using the DB2 Control Center, but the DB2 database is not local, create a local alias for the database before connecting.

To generate a list of tablespace IDs required for DB2DART, from the DB2 CLP, run


The output from the command, db2 list tablespace show details, indicates the number of free pages that exist in the tablespace, as well as the HWM. Ideally, the desired HWM is the value derived by subtracting totalPages - freePages. Use the resulting value as the target HWM when running DB2DART/LHWM.

Running statistics to optimize performance

To optimize performance, run statistics on your most volatile databases daily, and run statistics on your largest databases on weekends.

1. Open the DB2 Control Center.

2. Click All Databases, and then locate the initial DB2 database you created. If you did not change the default database name, the name is DOMINO.

3. Open the database, and then click Tables.

4. Select one or more tables on which you want to run statistics.

5. Right click the mouse, and then choose Run Statistics. The Run Statistics dialog box appears.


6. If you want to schedule when statistics are run, click the Schedule tab, and then choose Enable Scheduler.

7. Click OK.

Related topics