Deleting completed UOWs from the database (WorkHousekeeping)

To delete completed UOWs from the database, specify the WorkHousekeeping keyword when executing the icosutil utility. This keyword executes the WorkHousekeeping utility with the options specified on the command line. One of these options is a properties file that allows you to specify which completed UOWs to delete from the database.

Syntax

./icosutil WorkHousekeeping -f /opt/IBM/tivoli/netcool/ncm/config/properties/
workHousekeepingUtility.properties

Description

The WorkHousekeeping utility deletes completed UOWs from the database based on criteria specified in the workHousekeepingUtility.properties file. By default, the workHousekeepingUtility.properties file resides in the /opt/IBM/tivoli/netcool/ncm/config/properties directory.

For each UOW that is deleted, the WorkHousekeeping utility also deletes the corresponding native command files stored on the server. When this option is executed, a text file is produced in the running directory.

The WorkHousekeeping utility can retain or delete completed UOWs based on the following criteria:

  • firstNEntries
  • lastNEntries
  • startdate
  • enddate

Upon completion, the WorkHousekeeping utility creates a text file in the running directory. The WorkHousekeeping utility uses the following naming scheme:

WorkHouseKeeping_<TIMESTAMP>.txt

Where: TIMESTAMP specifies the date and time in which the WorkHousekeeping utility created the files.

Parameters

WorkHousekeeping
Specifies the keyword that instructs the icosutil utility to execute the WorkHousekeeping utility. The WorkHousekeeping utility proceeds to delete completed UOWs from the database based on criteria specified in the workHousekeepingUtility.properties file.
-f
Specifies an option when using the WorkHousekeeping keyword.
workHousekeepingUtility.properties
Specifies the workHousekeepingUtility.properties file that defines the criteria that the WorkHousekeeping utility uses to delete completed UOWs from the database.

Notes

As increasing numbers of network resources and configurations per resource are added to ITNCM - Base, housekeeping duties become particularly important to free up storage space and maximize run time performance. The following utilities perform these housekeeping duties:
ConfigArchive
Deletes versioned configurations from the database.
For more information, see Archiving and deleting versioned configurations from the database (ConfigArchive)
WorkHousekeeping
Deletes completed UOWs from the database.
Archive
Archives the UOW.
For more information, see Archiving a UOW (Archive).
Note: In order to perform Housekeeping duties using the previously listed utilities, the user must belong to a group with the Housekeeping and View All Work activity.

Using the WorkHousekeeping utility

The WorkHousekeeping utility can be run concurrently with other units of work. Other UOW types will not encounter work conflict warnings, or device already locked errors. This is because the config housekeeping process is running simultaneously.

Follow these steps to delete versioned configurations from the database:

  1. Edit the sample workHousekeepingUtility.properties file distributed with the ITNCM - Base software. This sample properties file demonstrates how the WorkHousekeeping utility works, and comes complete with examples. The workHousekeepingUtility.properties file can be configured to run with your system.
  2. Run the WorkHousekeeping utility using the following command:
    ./icosutil WorkHousekeeping -f /opt/IBM/tivoli/netcool/ncm/config/properties/
    workHousekeepingUtility.properties [-Xms] [-Xmx]
    Where:
    • -Xms — Sets the minimum size of the memory allocation pool (minimum heap size). Set this value to a multiple of 1024 that is greater than 1 MB. As a general rule, set minimum heap size (-Xms) equal to the maximum heap size (-Xmx).
    • -Xmx — Sets the maximum Java heap size. Set this value to a multiple of 1024 that is greater than 1 MB.
  3. Depending on whether the utility is being run with the Report-Only flag set to true or false, the utility will generate a list of the UOWs to be deleted, or it actually removes the selected UOWs. Either way, the report is generated.
  4. Review the report produced to verify that all expected UOWs were deleted.

Results

A ReportOnly option is available in the workHousekeepingUtility.properties file. If running with the ReportOnly option set to False, all completed UOWs that meet the selection criteria will be deleted completely from the database, Queue Manager, Resources tab, and the Reports tab.

If a UOW selected for deletion cannot be deleted due to insufficient security rights, the utility will cease to run. The utility can only work if the user has housekeeping privileges.

If running with the ReportOnly option set to True, a report will be generated that shows the number of completed UOWs that will be deleted.

This flag specifies whether or not the utility is being executed in ReportOnly mode. If the value is true, the work housekeeping utility report will show how many UOWs would have been deleted based upon the criteria, but the UOWs will not actually be deleted (this is useful for testing new criteria settings). If the value is false, the report is generated and the UOWs are permanently deleted from ITNCM - Base. The ReportOnly default value is true.