Purpose
This article provides steps to purge a large database in Shavlik Protect for maintenance purposes.
Resolution
To purge the database of old data (clean up):
Using Database Maintenance tool built into Protect:
- Launch Protect.
- Navigate to Tools > Operations > Database Maintenance.
(Note): In older versions this was under Tools > Database Maintenance. - 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'.
- Click Run Now. You will be prompted to confirm you want to run the maintenance task.
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. - 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
- In Protect, go into Manage > Items from the menu.
- 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.).
- You will be prompted to confirm when you click a delete option.
- 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:
- Launch the SQL Management Studio.
- Expand Databases.
- Right-click your ShavlikScans database and click Properties.
- Click Options.
- Change the Recovery Model from Full to Simple.
- Click OK.
- Right-click the ShavlikScans database again and click Tasks.
- Click Shrink> Files.
- Change the File type to log.
- Under Shrink Action, click Reorganize pages before releasing unused space and set the Shrink file to field to 0.
- Click OK. This truncates the transaction log to 0 bytes.
- (Optional) Repeat Steps 8 through 10 and reset the Recovery model to Full.
- Right-click the ShavlikScans database again and click Tasks.
- Click Shrink> Database and click OK.
- 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.
Product(s)
Shavlik Protect 9.x