﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Paul Randal  / My SQL Server Database is Corrupt - Now What?! / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 17:48:06 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>I would echo all the other comments, it's not "if" it is "[b][i]when[/i][/b]".  I always tell my clients, no one ever thought they would slam jumbo jets into skyscrapers but it happened.My current client have no SQL DR whatsoever so about to create their first DR plan.  Test &amp; prepare, great article Paul.[i][b]qh[/b][/i]</description><pubDate>Mon, 04 Mar 2013 10:13:29 GMT</pubDate><dc:creator>quackhandle1975</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>Nice Article!!</description><pubDate>Mon, 04 Feb 2013 01:13:19 GMT</pubDate><dc:creator>prettsons</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>Good article Paul - thanks.Things will and do go wrong - no one should try to kid themselves otherwise.The main thing we can do is our best damage limitation exercise.</description><pubDate>Fri, 01 Feb 2013 03:54:46 GMT</pubDate><dc:creator>Stuart Davies</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>I'm one of "those" people that kept saying that there were a million articles on how to determine if corruption had occurred and very few on what to do about it.  Thanks for rising to the occasion, Paul, and well done!</description><pubDate>Wed, 30 Jan 2013 07:47:30 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>Nope - something stopped the upgrade from completing. You'll need to go back to the copy you still have on 2005 and figure out what the corruption is there.</description><pubDate>Tue, 29 Jan 2013 15:25:42 GMT</pubDate><dc:creator>Paul Randal</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>Hi Paul,I have similar issue yesterday occurred after upgrading to the new version sql2008r2 from 2005 version. We haven't changed the compitible mode after the upgarde. I have followed all steps in your blogpost Initially, I have tried regular recover option like belowALTER DATABASE [MYDB] SET EMERGENCY;GOALTER DATABASE [MYDB] SET SINGLE_USER;GODBCC CHECKDB (N'MYDB', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS, ALL_ERRORMSGS;GOBut received Error:The database 'MYDB ' is in 611. The database needs to be updated to the latest version.Then I followed your blog post below: http://www.sqlskills.com/blogs/paul/creating-detaching-re-attaching-and-fixing-a-suspect-database/As it is reporting database, we are not concerned about the data but need the reporting store procedure from the corrupted dB. Issue: DBCC checkdb cannot be run , also I checked other post of you on fatal errors where dbcc checkdb can not be run, In this case Is there anyway we could get the stored procedures out of the corrupted database.</description><pubDate>Tue, 29 Jan 2013 15:02:44 GMT</pubDate><dc:creator>@SQLFRNDZ</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>[quote][b]SALIM ALI (1/29/2013)[/b][hr]Failover, Restore and RepairI think one has been forgotten, and it's one that's not to be taken likely because you have to know your data.  This method is Reconstruction.[/quote]Nope - not forgotten, just not useful to the vast majority of DBAs out there so not worth mentioning in a short, 1-200-level article such as this one.</description><pubDate>Tue, 29 Jan 2013 10:11:38 GMT</pubDate><dc:creator>Paul Randal</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>[quote][b]Ness (1/29/2013)[/b][hr]Hi, Would you run the DBCC CHECKDB with the REPAIR_REBUILD option (after recovery from a backup/HA solution)? I seem to remember that this was the preferred option the MS 2005 / 2008 MCITP learning. I know that real life can be far detached from the learning, or are you attempting to fix any Ix's individually?[/quote]I'd only run REPAIR_REBUILD if they were just nonclustered index errors that I couldn't fix by doing a manual rebuild or a drop/create inside a transaction. The advice in the MCITP learning is incorrect. Never put the database offline (i.e. from going into SINGLE_USER) if you can avoid it.</description><pubDate>Tue, 29 Jan 2013 10:10:07 GMT</pubDate><dc:creator>Paul Randal</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>Failover, Restore and RepairI think one has been forgotten, and it's one that's not to be taken likely because you have to know your data.  This method is Reconstruction.Sometimes, in the event of only having an old backup, it is possible to reconstruct the data in certain circumstances.  I had a table corruption s few years back where the only backup I could use for recovery was 3 weeks old.  {edit} This also had the corrption so I had to go back to an earlier tape copy {end edit} You can usually guarantee that if something is going to go wrong, it will go wrong when you're on leave and no-one will pick it up, leaving it for you to deal with upon return.The corruption was on the clustered index.  I was unable to drop it as I kept getting errors.  The clustered index ordered the data sequentially, so all the historic stuff was at the head of the table with the new data at the tail end.  The corruption was somewhere in the middle (dated prior to the last good backup, good!)..DBCC CHECKDB told me where the corruption was.DBCC IND ('trapezedata', {tablename},-1)provided me with a list of the PageIds for the corrupted tableI used these to fuel the next DBCC command...DBCC TRACEon(3604)DBCC PAGE ('{datanasename}',1,{PageID},3)GOprovided me with the data on that page.This allowed me to output all of the tail end data after the corrupted pages into a text file.  The data output was in the format similar to :Slot 54 Offset 0x10d4---------------------Record Type = PRIMARY_RECORDRecord Attributes =  NULL_BITMAP VARIABLE_COLUMNS484730D4:  003e0030  000a5d59  00000001  00000000 0.&amp;gt;.Y]..........484730E4:  00000000  00000000  00000000  00000000 ................484730F4:  0000002b  00000000  00000000  00000000 +...............48473104:  00000000  00000000  00000000  00120001 ................48473114:  02000000  4e004c00  494c4300      5453 .....L.N.CLISTLegId                            = 679257PassType                         = CLISpaceType                        = STNumSpacesPu                      = 1NumSpacesDo                      = 0FareTypeId                       = 0FareAmount                       = 0FundingSource1Amount             = 0FundingSource2Amount             = 0FundingSource3Amount             = 0FundingSourceId1                 = 43FundingSourceId2                 = 0FundingSourceId3                 = 0FundingSource4Amount             = 0FundingSource5Amount             = 0FundingSourceId4                 = 0FundingSourceId5                 = 0FareCalcType                     = 1I ran the DBCC PAGE for the newer pages/data that did not appear on the restored database , which I had restored to a copy table.  I loaded the resulting (and large) text file back into a temporary table, cleaned up the data to leave the column names and values and then transposed these back into columns with a little bit of TSQL scripting.I was then able to insert the latest data back into the restored table, drop the corrupted one and rename the restored one to replace it.No data loss, but there was some loss of functionality to the users system during the fix.It's a horrible position to be in and not an elegant or easy fix, but it can be done this way if you run out of ideas.</description><pubDate>Tue, 29 Jan 2013 04:34:08 GMT</pubDate><dc:creator>SALIM ALI</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>Try recovering from a backup first and then if that does not work try the following : http://www.sqlskills.com/blogs/paul/creating-detaching-re-attaching-and-fixing-a-suspect-database/</description><pubDate>Tue, 29 Jan 2013 03:59:22 GMT</pubDate><dc:creator>Ness</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>hi all,        i have deleted the tables in a database n particular sequence. after that the database name has changes as &amp;lt;databasename(suspect)&amp;gt;. What did it means? the database corrupted??? if it correpts how can i recover??? DBCC CHECKDB will useful to this.....?????</description><pubDate>Tue, 29 Jan 2013 03:49:21 GMT</pubDate><dc:creator>manik123</dc:creator></item><item><title>RE: My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>Hi, Would you run the DBCC CHECKDB with the REPAIR_REBUILD option (after recovery from a backup/HA solution)? I seem to remember that this was the preferred option the MS 2005 / 2008 MCITP learning. I know that real life can be far detached from the learning, or are you attempting to fix any Ix's individually?</description><pubDate>Tue, 29 Jan 2013 02:18:41 GMT</pubDate><dc:creator>Ness</dc:creator></item><item><title>My SQL Server Database is Corrupt - Now What?!</title><link>http://www.sqlservercentral.com/Forums/Topic1412747-2616-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Corruption/96117/"&gt;My SQL Server Database is Corrupt - Now What?!&lt;/A&gt;[/B]</description><pubDate>Mon, 28 Jan 2013 22:00:54 GMT</pubDate><dc:creator>Paul Randal</dc:creator></item></channel></rss>