SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Benefits of DBCC Check DB and performance


Benefits of DBCC Check DB and performance

Author
Message
mohan.bndr
mohan.bndr
Mr or Mrs. 500
Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)

Group: General Forum Members
Points: 506 Visits: 481
I have some confusion here with DBCC , as i know that DBCC will take a snapshot of the DB to perform a Check DB. Am i correct? If yes, then is there any benefit in using a snapshot in DBCC and how will DBCC perform a check DB on system DBs... Can any one please clarify me....

Thanks in advance !!!!
HanShi
HanShi
SSCrazy Eights
SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)

Group: General Forum Members
Points: 8538 Visits: 3718
Yes, the DBCC CHECKDB will create a (hidden) snapshot from the database. Because this is a clompletely automated process, you are not in control about the placement of the files. This could cause free space issues on disk if you have large full disk and a heavily used database.

You can create a snapshot manually and perform the CHECKDB against this manually created snapshot. This gives you the benefit of keeping in control of the (snapshot)files. You could put these files on a seperate disk. This way the CHECKDB will have less performance impact on the disks with the original databasefiles.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97479 Visits: 33013
But, by snapshotting to a seperate set of disks and then performing DBCC there, you won't be seeing the physical layout checks run against the original set of disks. If you go down this road, you'll still need to run DBCC PHYSICAL_ONLY to validate the original database files and their storage.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
HanShi
HanShi
SSCrazy Eights
SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)

Group: General Forum Members
Points: 8538 Visits: 3718
Grant Fritchey (8/20/2013)
But, by snapshotting to a seperate set of disks and then performing DBCC there, you won't be seeing the physical layout checks run against the original set of disks.

Doesn't that only apply to the changed data pages? The original version of all these changed data pages are stored in the snapshot file(s). All non-changed data pages are read from the database location.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97479 Visits: 33013
HanShi (8/20/2013)
Grant Fritchey (8/20/2013)
But, by snapshotting to a seperate set of disks and then performing DBCC there, you won't be seeing the physical layout checks run against the original set of disks.

Doesn't that only apply to the changed data pages? The original version of all these changed data pages are stored in the snapshot file(s). All non-changed data pages are read from the database location.


Even if it's only the changed data pages, then those are not getting checked. I'm fine with offloading logical checks to another server (backup & restore), but doing this just ensures that some parts of the system are not checked. Not an approach I can get excited about.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
GilaMonster
GilaMonster
SSC Guru
SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)

Group: General Forum Members
Points: 221592 Visits: 46281
Grant Fritchey (8/20/2013)
But, by snapshotting to a seperate set of disks and then performing DBCC there, you won't be seeing the physical layout checks run against the original set of disks.


Yes you are. The snapshot is just to get a transactionally-consistent view of the data. The only pages in the snapshot are ones that are changing at the time that CheckDB is running, if the source for those were damaged, you'd be getting massive errors during the copy-on-write process and the concurrent access anyway.

Saying that a snapshot means that the original data doesn't get checked means that the hidden snapshot is also not acceptable (it's on the same logical drive, not necessarily the same physical disk, definitely not the same spot on the disk), so you're advocating CheckDB with table locks as the only acceptable option.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


GilaMonster
GilaMonster
SSC Guru
SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)

Group: General Forum Members
Points: 221592 Visits: 46281
HanShi (8/19/2013)
This way the CHECKDB will have less performance impact on the disks with the original databasefiles.


Exceedingly unlikely, unless you happen to be running CheckDB at a time when large portions of the database are changing (which is a bad idea usually)

CheckDB's IO impact comes from reading every single allocated page in the database, not from writing to the snapshot.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97479 Visits: 33013
GilaMonster (8/20/2013)
Grant Fritchey (8/20/2013)
But, by snapshotting to a seperate set of disks and then performing DBCC there, you won't be seeing the physical layout checks run against the original set of disks.


Yes you are. The snapshot is just to get a transactionally-consistent view of the data. The only pages in the snapshot are ones that are changing at the time that CheckDB is running, if the source for those were damaged, you'd be getting massive errors during the copy-on-write process and the concurrent access anyway.

Saying that a snapshot means that the original data doesn't get checked means that the hidden snapshot is also not acceptable (it's on the same logical drive, not necessarily the same physical disk, definitely not the same spot on the disk), so you're advocating CheckDB with table locks as the only acceptable option.


I thought the internal/hidden snapshot was a different critter than the snapshots we create. But, hey, happy to be wrong.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Steve Jones
Steve Jones
SSC Guru
SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)SSC Guru (144K reputation)

Group: Administrators
Points: 144972 Visits: 19424
I think the internal snapshot for dbcc is the same process as a "database snapshot" using a sparse file in NTFS, but you don't have control over the placement of where it is.

From the OP, I'm not sure what the question means. When you run dbcc, you don't get to choose to use a snapshot or not. It uses a snapshot internally, but it also hits the existing database. A "database snapshot" you have created doesn't really change the way dbcc works.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
GilaMonster
GilaMonster
SSC Guru
SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)

Group: General Forum Members
Points: 221592 Visits: 46281
Grant Fritchey (8/20/2013)
I thought the internal/hidden snapshot was a different critter than the snapshots we create. But, hey, happy to be wrong.


No, the same thing, same behaviour, same mechanics.

The only difference with the CheckDB snapshot is that it's created on all editions (only on Enterprise can you create an explicit snapshot) and it puts the snapshot files into NTFS alternate streams.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search