Scheduling the automatic data cleanup


You can configure the Maintenance Server to schedule automatic data cleanup. These cleanup runs replace the scheduled NSH jobs that have previously been used to run cleanups. The Maintenance Server manages the cleanup activities, such as:

  • Start and stop the scheduled cleanup task
  • Add cleanup modules to a queue and run them sequentially

Daily cleanup runs the following jobs:

  • Cleanup JobRunEvent
  • Cleanup AuditTrail
  • Cleanup JobSchedule
  • Cleanup AuditResult
  • Cleanup ComplianceResult 
  • Cleanup PatchResult
  • Cleanup Deploy
  • Cleanup SharedData
  • Cleanup SnapshotResult 
  • Cleanup OldVersionComponent
  • Cleanup OldVersionJob

Setting up automatic data cleanup

To configure the Maintenance Server to enable automatic cleanup, create a cleanup schedule and define a cleanup frequency using blasadmin commands. 

Important

When a scheduled auto cleanup job is running, make sure that the jobs that are scheduled using the NSH scripts are not running. For information about scheduling jobs using the NSH scripts, see Scheduling-the-script-based-cleanup-job.

Do the following:

  1. Log in to the TrueSight Server Automation console.
  2. Deploy the Maintenance Server if it is not already deployed in your environment. For details, see Deploying-a-Maintenance-Server.  
  3. Right-click the Maintenance Server, and click Start.
  4. Run the following blasadmin command to change to the newly created Maintenance Server.
    switch <server_name>
    For example, switch MaintenanceServer
  5. Run the following blasadmin command to enable auto cleanup. By default, auto cleanup is disabled.
    set Maintenance EnableAutoCleanup True
  6. Run the following command to set the start time of the auto cleanup job as the current time of the Application Server:
    set Maintenance AutoCleanupDailyStartTime 
    For example, set Maintenance AutoCleanupDailyStartTime 20:00
  7. (optional) Run the following blasadmin commands:

    Command

    Description

    AutoCleanupDailyRunWindowInHours

    The number of hours the auto cleanup job runs. The default is four hours.

    AutoCleanupJobsCountThreshold

    Threshold of number of running jobs during the time window before the auto cleanup runs a task. The default is 50 running jobs. If the number of running jobs exceed this threshold, the auto cleanup task is not triggered.

    AutoCleanupDailyStartTime

    The time (in hh:mm format.) when the auto cleanup runs. The default is 00:00.

    AutoCleanupDailyWindowInHours

    The number of running hours for the auto cleanup. The default is 4 hours.

    AutoCleanupDaysOfTheWeekToRun

    The days of the week (in the comma separated format) when the auto cleanup runs. Specify only the first two letters of a day. For example, to run auto cleanup on Monday, Tuesday, and Thursday, specify Mo, Tu, Th, and so on. The default setting is blank, which indicates that the auto cleanup runs on all days.

    AutoCleanupRunIntervalInMinutes

    The interval (in minutes) at which the running of daily auto cleanup is checked. The default interval is 15 minutes.

    AutoCleanupMaxDurationPerCleanupCallInMinutes

    The maximum duration (in minutes) to be spend for an individual call to the cleanup service. The default is 30 minutes.

    AutoCleanupStatusReportRecipients

    A semi-colon separated list of email addresses that are notified about the status of the auto cleanup task.

    AutoCleanupStatusReportFrequency

    The frequency (in hours) at which the status report emails are sent. The default is 24 hours.

    AutoCleanupJobRunEventRetention

    The retention time (in days) for the Job Run Event cleanup task. The default is 30 days.

    AutoCleanupJobScheduleRetention

    The retention time (in days) for the Job Schedule cleanup task. The default is 30 days.

    AutoCleanupAuditTrailRetention

    The retention time (in days) for the Audit Trail cleanup task. The default is 30 days.

    AutoCleanupEnableUpdateGlobalIndex

    A Boolean value that indicates whether you want to enable the creation of global indexes for the table partitions that are marked as orphan entries. By default, the creation of global indexes is enabled for Oracle environments.
    Note: If you do not want to use table partitioning, change this command value to false before starting the auto cleanup task. Otherwise, the Maintenance Server logs display the following error:"No cleanup procedure by name: UpdateGlobalIndex
    com.bladelogic.om.infra.mfw.util.BlException: No cleanup procedure by name: UpdateGlobalIndex"

  8. Restart the Maintenance Server.

After configuring the Maintenance Server, the auto cleanup is skipped during the following scenarios:

Scenario

Result

The EnableAutoCleanup setting is set to false or not yet set (the default setting is false).

Auto cleanup is skipped and the Maintenance Server log shows the following message:
Daily Auto Cleanup operation <operation_name> skipped due to auto cleanup thread being disabled.

The auto cleanup is scheduled to run at 00:00 hours for 4 hours.

Auto cleanup is skipped and the Maintenance Server log shows the following message:
Daily Auto Cleanup operation <operation_name> skipped due to not being in a scheduled window.

Jobs are already scheduled to run in the future, such as 50 jobs scheduled to run within the next 2 hours.

Auto cleanup is skipped and the Maintenance Server log shows the following message:

Daily Auto Cleanup operation <operation_name> skipped due to future job load.

The current database utilization exceeds 80% of the maximum utilization. (Database load is checked for number of processes or transactions or sessions in the V$RESOURCE_LIMIT view against maximum utilization.)

Auto cleanup is skipped and the Maintenance Server log shows the following message:

Daily Auto Cleanup operation <operation_name> skipped due to current database load. 

Troubleshooting

If you observe any issues during cleanup, check the cleanup logs that are available at this path to troubleshoot the issues: installDirectory/br
For example:

  • (WindowsC:\Program Files\BMC Software\BladeLogic\appserver\NSH\br\<MaintenanceServer.log>
  • (Linux/opt/bmc/bladelogic/NSH/br/<MaintenanceServer.log>

The log file name is the name of the Maintenance Server deployment instance.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*