Myth #21: Database corruption can be resolved by restarting SQL Server or Windows, or by attaching and detaching databases
Error
None of the operations in SQL Server can repair data corruption. Damaged pages need to be repaired or restored by some mechanism-but not by restarting SQL Server,windows or by detaching additional databases.
In fact, if your database is damaged to a crash recovery, then separating the attached database will be the worst decision you can make. This principle is because the attached database contains crash recovery steps, and if crash recovery fails, the attach fails. So the following tips are what you need: TechEd demo:creating, detaching, re-attaching, and fixing a suspect database。 Remember, never detach a corrupted database.
The following types of errors are likely to be resolved by restarting:
- If the page in memory is corrupted, but when the page on disk is intact, the reboot resolves the corruption problem
- If the damage occurs, but a step in the restart process causes the page to be no longer allocated, it appears that the damage was resolved by rebooting, which I already have a blog post to elaborate on:misconceptions around Corruptions:can they Disappear?
- If the IO subsystem is also restarted and SQL Server requirements for IO are "jammed" by the IO subsystem, the reboot seems to solve the problem, but it is not actually a repair damage, but rather a recovery of the faulty IO subsystem. I've only met three or four times in this category.
Anyway, you're going to have to do a backup, at least. policy or easy system recovery and failover. Restarting is not a solution, it will only waste time.