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 123»»»

The Perils of Running Database Repair Expand / Collapse
Author
Message
Posted Sunday, June 24, 2012 11:30 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 2:09 PM
Points: 2,035, Visits: 1,655
Comments posted to this topic are about the item The Perils of Running Database Repair

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #1320437
Posted Monday, June 25, 2012 2:50 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, April 14, 2014 5:49 PM
Points: 2,263, Visits: 3,758
Thanks for taking your time in writing this useful article. By the by, in which language is the coding done.

Mohammed Moinudheen
Post #1320491
Posted Monday, June 25, 2012 2:58 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 12:20 PM
Points: 41,529, Visits: 34,445
If you're talking about the SQL Server database engine, Paul's said before on Twitter that it's mostly C++ with some assembler


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 #1320498
Posted Monday, June 25, 2012 5:15 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: 2 days ago @ 11:04 AM
Points: 510, Visits: 1,684
this is a great article about the perils of using the ALLOW_DATA_LOSS command, but i would be curious to know what Pauls recommendation are for a backup strategy.

when is the best time to run DBCC checks vs when you take a full backup?

and based on the timing of those, how does one ensure not to incur data loss?

Post #1320549
Posted Monday, June 25, 2012 5:40 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 2:09 PM
Points: 2,035, Visits: 1,655
Glad you like the article.

Backup strategy is dictated by what restores you want to be able to do, what the data volume is, what storage space you have, and so on. If you have an RTO of 8 hours with a zer data-loss RPO, you need to be able to restore from your most recent full backup and all the way up to the most recent log backup in 8 hours. Depending on the amount of change in the database, you're likely going to be using differential backups as well. Answering this question is an entire series of articles in itself.

As far as consistency checks are concerned, if you're able to, run them on the production system as often as you can. The quicker you can find that you have corruption, the more likely you'll be able to recover with the minimum downtime and data loss. If you can't run them in production, take your full backup, restore it somewhere, and run consistency checks on it. If its clean, you know the production database was clean at the time the backup was taken. This is another article-sized answer, but I hope that helps.

Thanks


Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #1320556
Posted Monday, June 25, 2012 5:52 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: 2 days ago @ 11:04 AM
Points: 510, Visits: 1,684
thanks Paul,

so i take daily fulls at 2 am. I take logs every 15 minutes.
I run DBCC checks daily at 8pm and have processes in place to email me when DBCC CHECKDB encounters errors.....

so if at 8 pm, i receive an error, how does one know what logs i can restore up to?
doesn't a corrupted DB backup corrupted?
Post #1320562
Posted Monday, June 25, 2012 5:57 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 2:09 PM
Points: 2,035, Visits: 1,655
You don't know which logs you can restore up to. If you want to guarantee zero data loss you can't rely on just backups - you need to have a redundant copy of the database that is synchronously updating from the production database - either using synchronous database mirroring or some kind of synchronous I/O subsystem replication/mirroring. Defense in depth - just like with security.

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #1320564
Posted Monday, June 25, 2012 6:01 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: 2 days ago @ 11:04 AM
Points: 510, Visits: 1,684
again, thank for clarifying that Paul...

so unless you have some hardcore redundancy, you most likely will always incur some data loss....
you can mitigate that loss by running DBCC CHECKDB often.
i have seen some recommendations on the web that you run it once a week and i was always puzzled by that strategy
Post #1320566
Posted Monday, June 25, 2012 6:08 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 2:09 PM
Points: 2,035, Visits: 1,655
No, you're not guaranteed that you'll have data loss, but it's more likely. As long as you're doing frequent log backups, and you're able to do a tail-of-the-log backup, you should be able to get away without data loss as long as your full and diff backups don't contain corruption. But there's no guarantee.

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #1320570
Posted Monday, June 25, 2012 7:40 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, April 14, 2014 10:01 AM
Points: 2,980, Visits: 762
Excellent article and thanks for answering the questions posted. It took me a couple of years and hard experience to finally upstanding the concepts of backup and restore plus database mirroring after coming from a development background. I still do not comprehend a lot of the disk mirror/replication, have to leave that to the networking/SAN group.

Thanks,
Thomas


Thomas LeBlanc, MCITP DBA 2005, 2008 & MCDBA 2000
http://thesmilingdba.blogspot.com/
Post #1320637
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse