Data Purge Issue
PhilJax
Posts: 15
Hi, the data purge options in SQL Monitor do not seem to do exactly as stated. Although the data is deleted for the instances and alerts etc, it does not seem to clean up the tables whose name ends with _UnstableSamples. Can the tables be cleared down?
Thanks in advance
Thanks in advance
Comments
One thing to note is that data is purged at start up and every hour after that, so it may take up to an hour for configuration changes to take effect. This wouldn't cause some of the tables to be being purged while others are not, however.
Are you looking at the number of rows in the tables, or the amount of storage used as reported by ssms?
After having a look at the code used to delete the records, I can see why 3/4 days would not be sufficient to clear down some of these tables after deleting the instances from monitoring (delete top (50000)).
The row count for the table I am looking at is 199,311,349 (Cluster_SqlServer_Sqlprocess_UnstableSamples).
The data purge settings were set to 1 week.
Although Monitor only deletes 50k rows at a time (to avoid the query holding locks for ages and/or timing out), the Base monitor will loop until it deletes less than 50k rows in an attempt, so it won't be limited to deleting 50k rows/hour.
It would be interesting to know what the earliest sample in the table is?
The earliest collection date in the table is 2010-12-01 10:33:37.207.
Thank you for your help tracking it down, and I'm sorry that you hit the issue.
There is 1 more thing that I noticed whilst investigating this, when all instances had been deleted from monitoring, I noticed that SQL Monitor continued to add data to the _UnstableSample tables. Is this behaviour by design?
Thanks,
PhilJax
Hi,
Apologies for this error.
As Phil mentioned that we are still investigating this issue. This issue is not happening in all the cases but we could reproduce it internally in few cases. We are hoping that we will be able to get to the bottom of it by early next week. Ones, we can reliably reproduce it then we will fix it asap and release a patch if possible next week itself. But I am afraid at this moment it is still under investigation.
It would help us to fix this issue if you could help us by answering few questions.
1. You mentioned that you are monitoring 10 servers. Is it 10 in total i.e. 10 machine and SQL Server in total OR 10 machine + 10 sql server?
2. What is your database size now?
3. What is your purge policy?
4. Could you please send the log files from base monitor machine to priya.sinha@red-gate.com? The location is C:\ProgramData\Red Gate\Logs\SQL Monitor 2 or C:\Documents and Settings\All Users\Application Data\Red Gate\Logs\SQL Monitor.
5. Are you running trace? If yes, then on how many SQL Server?
Thanks,
Priya
Project Manager
Red Gate Software
7 Machines/8 Instances
Trace is turned on in all instances.
Please let us know once a fix/workaround is in place. I'm going to have to shut down monitoring as it is affecting my other databases disk space availablility.
Hi,
Apologies for the error. Firstly, I would turn trace off on all SQL Server. Trace generates a lot of data and should be used very cautiously for only investigation purpose for short period of time.
The bug being discussed in this thread doesn't affect everyone. This is happening in very rare cases where purge is not able to delete few tables. You might be having a completely different issue with purge in your environment. Could you please send log file from base monitor machine so that we can investigate your issue? Please email to priya.sinha@red-gate.com. The location is C:\ProgramData\Red Gate\Logs\SQL Monitor 2 or C:\Documents and Settings\All Users\Application Data\Red Gate\Logs\SQL Monitor.
Thanks,
Priya
Project Manager
Red Gate Software
There are 91 log files in this directory. I'm assuming you want the ones that being with "Base Deployment...". Can you specify which ones and how far back you need?
If you send me latest 5 starting with Base ..
Thanks,
Priya
Project Manager
Red Gate Software
While we are working on a proper fix, running these couple of lines of SQL will recreate some of the lost information and will allow things that were missed to be purged again.
If this issue isn't actually causing problems for your installation, then I'd recommend just leaving things. If your database is getting too big, then this should help you out until we can get a proper, tested, fix out.
Yes, this issue is live in build 2.1. We are working on the fix which will be released very soon.
Regards,
Priya
Project Manager
Red Gate Software
Do you have a date for release 2.1?
If you don't want to wait for an hour then there is a hidden URL to kick off a manual purge, by going directly to this location:
You should see a green 'Data purge started' bar to confirm that it worked.
I hope that fixes it for you, at least until we get 2.2 out.
Is there a way to break up the insert statement and throw in some commits?
Then manually split that range into chunks that are small enough to complete
The Cluster_SqlServer_SqlProcess_Sightings table has 29 million rows. If that table is supposed to control what it deleted, it doesn't seem to be working.
This issue is now fixed in 2.2 release.
Regards,
Priya
Project Manager
Red Gate Software