Introduced in Feature Pack 2

Appendix: Using the Database Cleanup utility to delete RecipeCollection versioned data

Introduced in Feature Pack 2 This lesson demonstrates how to delete obsolete RecipeCollection version data from the database directly instead of deleting from the Management Center. You will configure the Database Cleanup utility to delete the versioned data of the Recipe and RecipeCollection related business objects. The Database Cleanup utility can only be performed on your runtime machine. You want to run the Database Cleanup utility on a regular basis to clear old data.

About this task

Procedure

  1. On your runtime machine, create a temp folder under any drive. For example, C:\temp.
  2. Create a file Cleanconf.sql in your temp folder.
  3. Copy and paste the following code into the SQL file.
    insert into cleanconf (objectname, type, statement, namearg, sequence, daysarg) values ('RecipeProject', 'obsolete', 'delete from cmversninfo where cmversninfo_id in (select cmversninfo_id from cmversninfo where ((days(current timestamp) - days(createtime)) >= ?) and ui_object_name in (''RecipeCollection''))', 'no', 1, 'yes');
    If you want to perform this command on a different platform, see: Configuring the Database Cleanup utility to delete more tables and columns
  4. Open a DB2 command-line window and run the following command:
    C:\temp>db2 -tvf Cleanconf.sql > cleanconf.log
    Note: Updating the cleanconf table only needs to be performed once.
  5. Check the log file cleanconf.log to ensure the command ran successfully.
  6. From a command prompt, navigate to the WC_installdir\bin directory, and run the following command:
    dbclean -object RecipeProject -type obsolete -dbpasswd password -instancexml C:\Websphere\CommerceServer70\instances\demo\xml\demo.xml -days 0 
    Note:
    • Once dbclean is configured, you can run the dbclean utility to delete versioned data that is older than a specific number of days.
    • For examples of running the Database Cleanup utility on a Unix system, see: Deleting catalog version objects .
  7. Navigate to the DB2 command line, and run the following command:
    db2 => select * from cmversninfo

Results

The version records for the ProjectCollection object are deleted.