Database Maintenance - Purging or Cleaning Up a Large Database

Version 8



    This article provides steps to purge a large database in Ivanti Patch for Windows for maintenance purposes.  



    To purge the database of old data (clean up):


    Using Database Maintenance tool built into Ivanti Patch for Windows:


    1. Launch Ivanti Patch for Windows.  
    2. Navigate to Tools > Options > Database Maintenance (Tools > Operations > Database Maintenance in Protect)
    3. Change the Delete results older than (days) or max results to keep to the desired amount.Optional): Enable the 'Rebuild Indexes' options and the option to 'Backup database and transaction log'.



         4. Click Run Now. You will be prompted to confirm you want to run the maintenance task.


         5. After clicking to run the maintenance task you should see a pop up in the lower right of your screen stating the database maintenance task has started and will run in the background.


         6. Wait approximately 15 minutes to allow time deletion of old results to take place. The operation runs as a background task and may take more or less time than this based on how many records are being deleted during the maintenance.


    Alternate method of deleting results using Manage > Items


    1. In Ivanti Patch for Windows, go into Manage > Items from the menu.
    2. You can select specific results to delete, then click 'Delete selected', or you can click 'Delete All'. This needs to be repeated for each type of results that you want to delete from your database (Patch Scans, Patch Deployments, etc.).
    3. You will be prompted to confirm when you click a delete option.
    4. You will then see a progress bar showing the status of the deletion of results. If you have a large amount of results to be deteted, this can take some time to run.


    Additional optional steps to be performed within SQL Management Studio:


    1. Launch the SQL Management Studio. 
    2. Expand Databases
    3. Right-click your ShavlikScans database and click Properties
    4. Click Options
    5. Change the Recovery Model from Full to Simple
    6. Click OK
    7. Right-click the IvantiScans database again and click Tasks
    8. Click Shrink > Files
    9. Change the File type to log
    10. Under Shrink Action, click Reorganize pages before releasing unused space and set the Shrink file to field to 0.
    11. Click OK. This truncates the transaction log to 0 bytes.
    12. (Optional) Repeat Steps 8 through 10 and reset the Recovery model to Full
    13. Right-click the ShavlikScans database again and click Tasks
    14. Click Shrink > Database and click OK
    15. Wait for the shrink operation to complete. In case of large databases, it may take a long time to complete.  


    Additional Information


    If you are using SQL Express you may need to install the SQL Management Studio for express editions before you can perform the actions described above. The links for SQL Express Management Studio downloads can be found here.




    Ivanti Patch for Windows Servers 9.3.x

    Protect 9.2.x