Solved

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

Posted on 2014-10-05
7
235 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 49

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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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 49

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 49

Expert Comment

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

Cheers
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Upgrading to SQL Server 2015 Express 2 31
SQL Server Express automatically execute SQL or SP 8 32
SQL Syntax 6 41
Need multiple Group By's 8 23
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

756 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