Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

Help, my database is corrupt. Now what? Expand / Collapse
Author
Message
Posted Monday, February 16, 2009 3:29 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 5:13 AM
Points: 32,906, Visits: 26,793
Awesome article, Gail. Wish I had it when MSDB went sour on one of my Dev servers especially since my predecessors saw no need to backup a Dev Server. How much of this applies to the system's databases (not including TempDB, of course)? And, pardon my ignorance on the subject... I'm more of an Application DBA than a System's DBA.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #658115
Posted Monday, February 16, 2009 3:57 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, May 02, 2013 2:13 AM
Points: 362, Visits: 324
At the risk of being redundant, excellent article, Gail. It should be compulsory "calm down and think" reading for any DBA facing an apparent catastrophe. Bookmarked and link mailed to collegues.

Stephen



Post #658131
Posted Monday, February 16, 2009 4:13 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, May 12, 2013 11:47 PM
Points: 356, Visits: 700
SDM (2/16/2009)
At the risk of being redundant, excellent article, Gail. It should be compulsory "calm down and think" reading for any DBA facing an apparent catastrophe. ..
Stephen

Same from me - there should be a prize for you, and not just for this article. This is so helpful to all accidental DBA's ... it's not funny!
Post #658136
Posted Monday, February 16, 2009 9:50 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 11:00 AM
Points: 217, Visits: 152
Great article. Thanks for taking the time to create it. An excellent resource for sure.
Post #658188
Posted Tuesday, February 17, 2009 12:08 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 5:31 AM
Points: 37,725, Visits: 29,984
Jeff Moden (2/16/2009)
How much of this applies to the system's databases (not including TempDB, of course)?


MSDB can be repaired, I believe (haven't tried it). Master I would recommend restore or rebuild, though I have seen someone repair it successfully. Model, since it should have nothing in it, you should be able to copy from another server.

Depends what the corruption is. If it's just in the nonclusters, then repair's probably safe even in the system databases. If it's in the clustered index then my recommendation would be restore or rebuild (especially with master)

Master and msdb can be completely recreated, by the rebuild master function of the installer (master) or by script (msdb). It won't get any data back, but it will get the DB usable and free of corruption.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #658237
Posted Tuesday, February 17, 2009 5:29 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 2:27 PM
Points: 21,357, Visits: 9,537
GilaMonster (2/17/2009)
Jeff Moden (2/16/2009)
How much of this applies to the system's databases (not including TempDB, of course)?


MSDB can be repaired, I believe (haven't tried it). Master I would recommend restore or rebuild, though I have seen someone repair it successfully. Model, since it should have nothing in it, you should be able to copy from another server.

Depends what the corruption is. If it's just in the nonclusters, then repair's probably safe even in the system databases. If it's in the clustered index then my recommendation would be restore or rebuild (especially with master)

Master and msdb can be completely recreated, by the rebuild master function of the installer (master) or by script (msdb). It won't get any data back, but it will get the DB usable and free of corruption.



That begs this question... assuming you have a corrupt backup of msdb, can you rebuild it then reimport the data back in?
Post #658397
Posted Tuesday, February 17, 2009 5:45 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Friday, May 17, 2013 12:22 PM
Points: 10,571, Visits: 11,871
GilaMonster (2/17/2009)
Jeff Moden (2/16/2009)
How much of this applies to the system's databases (not including TempDB, of course)?


MSDB can be repaired, I believe (haven't tried it). Master I would recommend restore or rebuild, though I have seen someone repair it successfully. Model, since it should have nothing in it, you should be able to copy from another server.

Depends what the corruption is. If it's just in the nonclusters, then repair's probably safe even in the system databases. If it's in the clustered index then my recommendation would be restore or rebuild (especially with master)

Master and msdb can be completely recreated, by the rebuild master function of the installer (master) or by script (msdb). It won't get any data back, but it will get the DB usable and free of corruption.


I had to deal with a suspect msdb (SQL 2000) with no backups, so I had to recreate it. This was one of those departmental installs of SQL Server that I was not involved with until it crashed. There were some good articles on MSDN on how to do it.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #658406
Posted Tuesday, February 17, 2009 8:03 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 2:10 PM
Points: 2,117, Visits: 2,211
Thanks for the article. As you said, I hope I will never need it - though just last week I saw the first, trivial, error that I repaired with the DBCC UPDATEUSAGE command, before you had posted your article. That was scary enough that I read your entire article when I saw the title, and I immediately added it to my briefcase as soon as I was done.

This is a great service to the community. Thanks again!

webrunner


-------------------
"The chemistry must be respected." - Walter White

"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Post #658541
Posted Tuesday, February 17, 2009 9:45 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 3:08 PM
Points: 255, Visits: 2,407
This article was well written. I appreciate the time you took to lay it all out in a logical manner and to explain the different scenarios. Most helpful. Thanks.
Post #658628
Posted Tuesday, February 17, 2009 10:12 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 1:35 AM
Points: 4,789, Visits: 1,336
Great article. Fantastic way of writing....




Post #658650
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse