Solved

DBCC checkdb (repair)-- any way to split it up or watch progress?

Posted on 2014-10-05
7
224 Views
Last Modified: 2014-10-06
We have a large database with a partitioned table (1.5 TB partitioned by year 2003 to 2014) that showed errors detected by dbcc checkdb (physical only) -- about 80 errors, all limited to TWO of the partitions.  Because the database was running in simple recovery mode, we could not just replace damaged filetables or pages.

Running dbcc checkdb (repair_allow_data_loss) is taking forever (more than 36 hours), and it has failed 5 times so far, asking for expansions of different file groups-- most of which didn't have errors.  Each time we have run it, it has run for a while longer (several hours longer) then crashes,  asking for expansion of a different filegroup.

I can expand one file group, then two runs later, after it has crashed and asked for expansion of other file groups, it will come back and crash asking for expansion of a file group I have already expanded.

1.  Why is it involving filegroups that were not detected as bad by dbcc checkdb originally

2.  Every time it crashes, is it losing everything it accomplished in the hours it spent before the crash?

3.  Is there some way to do this piecemeal, one partition at a time.
0
Comment
Question by:dakota5
  • 3
  • 3
7 Comments
 
LVL 3

Expert Comment

by:alanccw
ID: 40362784
Can you post the error logs?
0
 

Author Comment

by:dakota5
ID: 40362871
They aren't very useful.  The first just lists the pages and object IDs for the corruption; the second during repair states which filegroup is too small and asks me to make it larger.
DBCC-checkdb-fileonly-ExpertsExchange.tx
DBCC-crash-with-error-asking-for-space-E
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 40363095
You can check each filegroup at a time but for repairing the only command available is the DBCC CHECKDB.
DBCC CHECKFILEGROUP (1)  -- Parameter is the filegroup number

Open in new window

0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

Author Comment

by:dakota5
ID: 40363437
OK-- But why is it touching filegroups that did not have corruption revealed by DBCC checkdb?
What could DBCC checkdb (repair) be doing to these non-corrupted filegroups.

These filegroups all involve clustered indexes. Is it rebuilding indexes that are not corrupted.  How can I determine what DBCC checkdb (repair) is actually doing?
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40363452
The DBCC CHECKDB with repair option doesn't mean that it going to work only on corrupted data. It means "do a full check database and if you find an error try to repair it".

From BOL you have:
After the DBCC CHECKDB command finishes, a message is written to the SQL Server error log.
(...)
A dump file (SQLDUMPnnnn.txt) is created in the SQL Server LOG directory whenever DBCC CHECKDB detects a corruption error.

Here's a link to everything you need to know about DBCC. It was written by Paul Randall, just the man that rewrote the DBCC CHECKDB command for SQL Server 2005 and knows more about it than other person in the world.
0
 

Author Closing Comment

by:dakota5
ID: 40363482
OK.  Now I get it.
Also, thanks for the link to Paul Randall's site.  That is an important reference.
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 40363487
That is an important reference.
It's the Bible for DBCC CHECKDB ;)

Cheers
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now