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

Benefits of DBCC Check DB and performance Expand / Collapse
Author
Message
Posted Monday, August 19, 2013 7:16 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, June 27, 2014 6:10 AM
Points: 104, Visits: 400
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 !!!!

Post #1485794
Posted Monday, August 19, 2013 7:28 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 7:50 AM
Points: 2,262, Visits: 2,725
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’! **
Post #1485806
Posted Tuesday, August 20, 2013 7:00 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 10:09 AM
Points: 15,661, Visits: 28,050
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1486230
Posted Tuesday, August 20, 2013 7:06 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 7:50 AM
Points: 2,262, Visits: 2,725
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’! **
Post #1486234
Posted Tuesday, August 20, 2013 7:24 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 10:09 AM
Points: 15,661, Visits: 28,050
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1486247
Posted Tuesday, August 20, 2013 7:29 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: Today @ 7:53 AM
Points: 42,822, Visits: 35,952
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 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 #1486250
Posted Tuesday, August 20, 2013 7:32 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: Today @ 7:53 AM
Points: 42,822, Visits: 35,952
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 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 #1486252
Posted Tuesday, August 20, 2013 8:20 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 10:09 AM
Points: 15,661, Visits: 28,050
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1486275
Posted Tuesday, August 20, 2013 8:36 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 1:16 PM
Points: 33,202, Visits: 15,345
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
Post #1486281
Posted Tuesday, August 20, 2013 9:09 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: Today @ 7:53 AM
Points: 42,822, Visits: 35,952
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 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 #1486305
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse