Page tree
Skip to end of metadata
Go to start of metadata

The cleanupDatabase command, used by the Database Cleanup script, helps you minimize the amount of space taken up by unused data. This cleanup utility deletes any data from the database that has been previously marked for deletion. This data includes:

  • Objects that users have already deleted in the BMC Server Automation Console.
  • Objects marked as deleted with the retention policy utility. These objects include old job runs and job and depot objects automatically created during patching and auto-remediation.

Note

Certain objects are not deleted due to potential object dependencies. The cleanup process deletes all top-level model objects of the classes listed in the hk_allowed_classes database table, as well as all their child classes (which are not listed in this table). BMC recommends that you do NOT modify the contents of the hk_allowed_classes table.

Database cleanup works in conjunction with the retention policy utility. This utility lets you mark for deletion from the BMC Server Automation database old job runs and objects automatically generated by operations such as autoremediation and patch analysis. For information about the retention policy utility, see Marking data for deletion.

Before cleaning up the database, you can run the following database query to determine how many depot objects the database cleanup utility deletes:

select count (*) from depot_object where is_deleted = '1';

While the database cleanup command is running, if you query again, the initial result displays until the cleanup completes. The result drops to 0 when the cleanup completes.