So I ran a query on my WebInspect database and see that I have a LOT of scan data in the db for a lot of scans that were deleted from the WebInspect Enterprise GUI.
Currently, I have 1344 scans in my WebInspect Enterprise console. According to the numbers above, there are 15,692 scans in the db that failed to archive, and 127 that are "deleting".
How can I purge all of the info for these orphan scans from the database and reclaim the space?
I know that I can run DELETE FROM Scan WHERE ScanID='Specific ScanID', but this doesn't delete all remnants of the scan and free up the space in the database.
Is there a way that this query can be modified to delete scans that are in a specific scan state (i.e. scan state 4).
Would this work?
DECLARE ScansToDelete CURSOR for SELECT ScanID FROM Scan WHERE ScanState = 4 OPEN ScansToDelete
Sounds reasonable; however, I would:
- Make sure you have a backup of your database
- Test in non-production first
- Include the rest of the initial script. 🙂
Just for anyone else who may have the same question:
substituting the ScanState in place of the date does work. I was able to purge some scans that were stuck in ScanState 18 using it.