Monday, December 5, 2016

SCCM Corrupted Statistics

Corrupted SQL Statistics.  Yup.  A client was recently noticing the "Update Statistics" maintenance task was failing with the error message "Cannot continue the execution because the session is in the kill state."  Not a very friendly message at all.

So the first step to this was to narrow down why "Update Statistics" on the SQL database was failing.  After a few runs we noticed it always failed at the same place "[dbo].[PullDPResponse]".  That narrows it down.  Now that we knew the problem area we browsed down to the table mentioned and expanded the "Statistics" node.  From here we decided to run a quick test against each of these.  We used the command "DBCC SHOW_STATISTICS" like in the image below.

So, from this image you can see we ran the command against the "PullDPResponse_PK" and we got results such as the last time it was updated.  So we continued running this command against each of the statistics.  And of course its always the last one you check BUT one of the statistics came back with a familiar error message.

Okay, now we know the culprit.  "_WS_Sys_08000002_133EF7BF" is corrupted and is why the "Update Statistics" task continues to fail.  So we simply ran a "DROP" on that corrupted statistic.

Now with that out of the way we once again ran the "Update Statistics" maintenance task and it completed successfully.

Now, to ensure the integrity of the database was still solid we ran a quick "DBCC CHECKDB".

And that is all.  Another successful fix.  It was an easy fix but when it comes to errors in SQL it can definitely leave you unsettled and worried that your going to have a long night ensuring your backups are up to date.  In this scenario we didn't have to resort to that and was able to resolve the issue without any serious downtime.  Hopefully this helps save you from any headaches if you see it arise.

No comments:

Post a Comment