SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On



does dbcc check also repair with only Expand / Collapse
Author
Message
Posted Wednesday, December 09, 2009 5:22 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, December 09, 2009 6:06 AM
Points: 2, Visits: 18
Does the following statement also repair found errors and/or minor issues or does this statement repair nothing but only show information on existing errors?

DBCC CHECKDB ('databasename') with physical_only
Post #831301
Posted Wednesday, December 09, 2009 6:01 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:26 AM
Points: 17,125, Visits: 12,228
CheckDB does not repair unless a repair level is specified.

Please note, repair should never be the first thing considered for a corruption problem. In many cases it's the last resort. If you have corruption, post the errors here (from a full checkDB not one with physical only) and someone will advise you on what to do.



Gail Shaw

We walk in the dark places no others will enter
We stand on the bridge and none may pass

Post #831316
Posted Wednesday, December 09, 2009 6:02 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, March 19, 2010 8:29 AM
Points: 1,644, Visits: 4,240
This will not repair anything, it simply scans the database for physical structure errors and is a lot quicker to run that a full scan does a lot more logical checks.

To repair you need to use a REPAIR option with the appropriate type of repair REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD

You need to aware of the potential data loss of repairing, restoring from a good-backup is preferable.

Post #831319
Posted Wednesday, December 09, 2009 6:06 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:26 AM
Points: 17,125, Visits: 12,228
steveb. (12/9/2009)
This will not repair anything, it simply scans the database for physical structure errors and is a lot quicker to run that a full scan does a lot more logical checks.


However it will only detect physical corruptions. There are a lot of potential corruptions that a physical only check will not pick up.



Gail Shaw

We walk in the dark places no others will enter
We stand on the bridge and none may pass

Post #831321
Posted Wednesday, December 09, 2009 7:59 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:15 PM
Points: 1,526, Visits: 1,209
On 2000 it will actually fix up incorrect PFS page free space bits silently, even if you don't say to do repairs. There was a bug in the algorithm that maintains them (in the main Storage Engine, not in CHECKDB) so it was deemed easier to just repair them than fix the bug - it was fixed in 2005.

Apart from that, it won't do any repairs.


Paul Randal
CEO, SQLskills.com - Need a database maintenance/ops/HA/DR audit? Send me email!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine and SQL Server Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #831428
« Prev Topic | Next Topic »


Permissions Expand / Collapse