Database marked as suspect?

I just ran into a situation like this, with the CPLS where I’m teaching: “Calin, you’re the guy I was expecting to call!”. Riiight, all of a sudden there’s big love among us, right? Nope, it was a database that was marked as suspect. For no particular reason.
Okay, do you have backups? From yesterday. Are you willing to lose one day of work? Yes. And the database was restored. And it worked.
But guess what, the thing went “suspect” again. And again.
Do you see a pattern here? I didn’t, but it struck me last night: it was the antivirus!!! Because the machine is not really a server, but rather a Windows 7 x64, they shut it down overnight. When it comes back online, if that stupid antivirus thing was doing some updates to a virus definition (and they seem to do it every 2 minutes these days), when you start the machine, the antivirus kicks in a file scan. Because the SQL Server service is among the last ones to start, guess what, the database files might be locked by the antivirus.
So, as a conclusion, you might want to check whether you have an antivirus on the box in the first place. If you do, I would say that you include the mdf and ldf files in the list of exclusions.
I hope this helps.
best regards,
io

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.