Database Cleanup utility

The Database Cleanup utility allows you to delete objects from the database. You may want to do this if you have changed a lot of information in your database and have unused tables or rows.

When the Database Cleanup utility deletes an object, the records in the object's tables are deleted to preserve the referential integrity of the database. The Database Cleanup utility deletes records in child tables based on the delete rule of the referential integrity definition in the database schema. You can set the delete rule to on delete cascade, on delete set null, or on delete restrict. If you add new tables, ensure that the referential integrity and delete rule is properly defined. Otherwise, the Database Cleanup utility cannot work with your new tables.

Tips:

  1. If you are migrating from an existing version of WebSphere Commerce, you can run the Database Cleanup utility after your migration. Remember to evaluate the types of data on your system and how they affect database maintenance; typically, user and order data can be quite large, resulting in large database tables. When you clean the database, this will be time consuming since it can fill up your database transaction log files or potentially lock database tables when your store is running.
  2. You should only run the Database Cleanup utility on a staging server to clean the staglog object. The staging database is different from the production database. The staging database only has configuration data without the operation data. Deleting configuration data might cause a delete cascade on the operation data. When the Stage Propagate utility propagates the deletion to the production database, this might cause a cascade delete to the operation data (which you want to keep). To clean configuration data, run the Database Cleanup utility on the production database.
  3. DB2Depending on the amount of cleanup required for your database, you should consider running the DB2 REORGCHK utility prior to running the DBClean to improve performance during the cleanup.

To monitor the Database Cleanup utility, refer to the following files:

The Database Cleanup utility is also configurable. Aside from the preset cleanup configurations, you can add new objects to the database table to define which tables and rows to clean, by updating the Database Cleanup utility configuration data in the CLEANCONF table. To extend the Database Cleanup utility, specify values for the jdbcDriver and jdbcUrlPrefix parameters when running the utility.

If you have extended your database schema by creating new tables, you can use the Database Cleanup utility to clean your new tables. If you have changed your database schema (such as adding new columns to one table, changing the foreign key primary key relationship, or adding a new child table to the referential integrity path), the Database Cleanup utility will automatically adapt to the changes. If you change the column names, update the configuration data in the CLEANCONF table.

Feedback