snippetMinor
How to Resolve Corruption Detected by BACKUP WITH CHECKSUM, But NOT DBCC CHECKDB?
Viewed 0 times
withbutdbccdetectedchecksumcheckdbresolvehownotcorruption
Problem
Recently, I was asked to refresh a couple of databases on a test server from production. Always wanting to follow best practices, I performed the backup using the WITH CHECKSUM option, and eventually got the following error:
Surprised at the error, I ran DBCC CHECKDB to see what's going on, but unfortunately (or perhaps fortunately), it comes back clean.
All of the information I have found so far encourages the use of DBCC CHECKDB's findings as a guide on where to go next, so I'm not sure how to fix this?
Some quick info:
-
SQL Server is 2008 R2.
-
I found confirmation of the error in the msdb.dbo.suspect_pages table. It contains event types 1 and 3.
-
The DBCC command I used was DBCC CHECKDB (DBName) WITH NO_INFOMSGS, ALL_ERRORMSGS;
-
I am not the official DBA, but since I have some experience, I was permitted to perform the backup and restore.
-
I did read the similar post What types of corruption can DBCC CheckDB miss?. However, while I believe I understand why (the point of that post), I don't know how to resolve it.
-
I was able to successfully perform the backup by omitting the WITH CHECKSUM option.
Thanks in advance for any guidance!
UPDATE
The comment provided by "usr" below got me on the right track. Just what exactly does page (1:428321) contain? I did some more research and found the DBCC PAGE command. However, I noticed something odd. When I executed the following...
I got the following back (note the page number on the first line)...
```
PAGE: (1:2021305)
BUFFER:
BUF @0x0000000CFEFCC580
bpage = 0x0000000CFE764000 bhash = 0x0000000000000000 bpageno = (1:428321)
bdbid = 18 breferences = 0 b
Msg 3043, Level 16, State 1, Line 32
BACKUP 'DBName' detected an error on page (1:428321) in file 'F:\path\DBName.mdf'.
Msg 3013, Level 16, State 1, Line 32
BACKUP DATABASE is terminating abnormally.Surprised at the error, I ran DBCC CHECKDB to see what's going on, but unfortunately (or perhaps fortunately), it comes back clean.
All of the information I have found so far encourages the use of DBCC CHECKDB's findings as a guide on where to go next, so I'm not sure how to fix this?
Some quick info:
-
SQL Server is 2008 R2.
-
I found confirmation of the error in the msdb.dbo.suspect_pages table. It contains event types 1 and 3.
-
The DBCC command I used was DBCC CHECKDB (DBName) WITH NO_INFOMSGS, ALL_ERRORMSGS;
-
I am not the official DBA, but since I have some experience, I was permitted to perform the backup and restore.
-
I did read the similar post What types of corruption can DBCC CheckDB miss?. However, while I believe I understand why (the point of that post), I don't know how to resolve it.
-
I was able to successfully perform the backup by omitting the WITH CHECKSUM option.
Thanks in advance for any guidance!
UPDATE
The comment provided by "usr" below got me on the right track. Just what exactly does page (1:428321) contain? I did some more research and found the DBCC PAGE command. However, I noticed something odd. When I executed the following...
DBCC TRACEON (3604);
DBCC PAGE ('DBName', 1, 428321, 3);I got the following back (note the page number on the first line)...
```
PAGE: (1:2021305)
BUFFER:
BUF @0x0000000CFEFCC580
bpage = 0x0000000CFE764000 bhash = 0x0000000000000000 bpageno = (1:428321)
bdbid = 18 breferences = 0 b
Solution
I'm not sure how to fix this
In the comments we investigated but never found out conclusively whether the page is allocated or not.
If it's allocated this is definitely a corruption that
If it's not allocated here's how I would fix it: Fill the file with dummy data e.g.
Actually, you can use this idea to test whether SQL Server thinks the page is allocated. If this works it's definitely not allocated.
Alternatively, you could use the write page feature to zero fill the page but that leaves an audit trace in the database boot page. Microsoft support will not like finding this, I guess, when they help you in the future with something. They might think your page write caused damage. Also, it steals all the fun from this investigation by terminating it without resolution :)
In the comments we investigated but never found out conclusively whether the page is allocated or not.
If it's allocated this is definitely a corruption that
CHECKDB missed. A bug in CHECKDB. Please report that to Microsoft.If it's not allocated here's how I would fix it: Fill the file with dummy data e.g.
CONVERT(binary(8000), 0x). Now the page should have been consumed by the dummy data and overwritten with something clean.Actually, you can use this idea to test whether SQL Server thinks the page is allocated. If this works it's definitely not allocated.
Alternatively, you could use the write page feature to zero fill the page but that leaves an audit trace in the database boot page. Microsoft support will not like finding this, I guess, when they help you in the future with something. They might think your page write caused damage. Also, it steals all the fun from this investigation by terminating it without resolution :)
Context
StackExchange Database Administrators Q#127641, answer score: 2
Revisions (0)
No revisions yet.