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 Tuesday, August 20, 2013 9:11 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:23 AM
Points: 13,923, Visits: 28,315
GilaMonster (8/20/2013)
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.


But if you run DBCC against a snapshot, do you get another snapshot? And since it's going back to the original pages anyway for all the reads, what's the point of separating it out?


----------------------------------------------------
"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
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 #1486309
Posted Tuesday, August 20, 2013 9:14 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 @ 6:05 AM
Points: 40,258, Visits: 36,681
Grant Fritchey (8/20/2013)
GilaMonster (8/20/2013)
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.


But if you run DBCC against a snapshot, do you get another snapshot?


No.

And since it's going back to the original pages anyway for all the reads, what's the point of separating it out?


Transactional consistency for logical checks. Otherwise you'd have to do it the SQL 2000 way, of running crash recovery in-memory to get a stable view of the tables. Massively complex. Snapshots ensure transactional consistency and a stable view of the tables which means that the CheckDB process doesn't have to worry about concurrent changes while working through the database.

That's why the alternative to using a snapshot is WITH TABLOCK - take table level locks to ensure the table can't change while being checked.



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 #1486310
Posted Tuesday, August 20, 2013 9:33 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:23 AM
Points: 13,923, Visits: 28,315
GilaMonster (8/20/2013)
Grant Fritchey (8/20/2013)
GilaMonster (8/20/2013)
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.


But if you run DBCC against a snapshot, do you get another snapshot?


No.

And since it's going back to the original pages anyway for all the reads, what's the point of separating it out?


Transactional consistency for logical checks. Otherwise you'd have to do it the SQL 2000 way, of running crash recovery in-memory to get a stable view of the tables. Massively complex. Snapshots ensure transactional consistency and a stable view of the tables which means that the CheckDB process doesn't have to worry about concurrent changes while working through the database.

That's why the alternative to using a snapshot is WITH TABLOCK - take table level locks to ensure the table can't change while being checked.


Sorry, you misunderstood the second part of that question. Not why does Microsoft create a snapshot when doing DBCC. I've read Paul's explanation there. I meant, why would you create your own snapshot first?


----------------------------------------------------
"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
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 #1486321
Posted Tuesday, August 20, 2013 9:49 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 @ 6:05 AM
Points: 40,258, Visits: 36,681
Grant Fritchey (8/20/2013)
I meant, why would you create your own snapshot first?


I wouldn't.
Only reason maybe is if the drive with the data files on is nearly full and there's enough concurrent activity that the snapshot runs the drive out of space. But in that case there are other problems that need to be fixed.

Other case, when there's some filter driver or other installed software that breaks NTFS alternate streams. In that case CheckDB will fail, so you can try and run CheckDB on an explicitly created snapshot to see if the problem is just the alternate streams and as a way to run until the offending software gets fixed or removed.



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 #1486338
Posted Thursday, August 29, 2013 2:30 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Yesterday @ 11:34 PM
Points: 104, Visits: 404
Thanks for understanding to get the Checkdb implementations with the snapshots.
Post #1489600
Posted Thursday, August 29, 2013 2:33 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Yesterday @ 11:34 PM
Points: 104, Visits: 404
GilaMonster (8/20/2013)
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.


Thanks for understanding to get the Checkdb implementations with the snapshots. But here one more thing , will it DBCC Checkdb work on standard edition as i am not able to run DBCC Checkdb against database and the drive also having sufficient free space for datafile. Will it DBCC Checkdb creates snapshot in standard edition ? and Will it be possible to create snapshot by manually in standard edition?.... Please advise !
Post #1489601
Posted Thursday, August 29, 2013 2:54 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 @ 6:05 AM
Points: 40,258, Visits: 36,681
Yes, checkDB works fine on Standard Edition, and all other editions. It does create the hidden snapshot on all editions.


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 #1489608
Posted Thursday, August 29, 2013 3:14 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, October 27, 2014 8:18 AM
Points: 2,404, Visits: 2,940
mohan.bndr (8/29/2013)
... as i am not able to run DBCC Checkdb against database and the drive also having sufficient free space for datafile....

What is the error message you get when you execute the CHECKDB command?


** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Post #1489616
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse