September 17, 2008 at 12:08 am
We perform 1. DBCC CHECKDB and 2. DBCC REINDEX every week-end.
Is there any specific order we need to execute this command?
Is it better to execute DBCC CHECKDB after DBCC REINDEXing?
September 17, 2008 at 12:19 am
DBCC CHECKDB checks the linkages and sizes of text, ntext, and image pages for each table, and the allocation of all the pages in the database.
For each table in the database, DBCC CHECKDB checks that:
Index and data pages are correctly linked.
Indexes are in their proper sort order.
So order can be DBCC Checkdb and DBCC Reindex
September 17, 2008 at 12:28 am
For each table in the database, DBCC CHECKDB checks that:
Index and data pages are correctly linked.
Indexes are in their proper sort order.
So order can be DBCC Checkdb and DBCC Reindex [/i]
CheckDB checks index and data pages linkage so does it make sense to execute CHECKDB after DBCC REINDEX?
September 17, 2008 at 12:58 am
I'd run it before. There's not much point in doing expensive maintenance on a database that's corrupt. If there's any corruption present, the reindex would probably throw errors anyway.
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
September 17, 2008 at 6:50 am
Gail,
This is weekly maintenance plan and we run both DBCC command in the same job.
What do you suggest to run first? CHECKDB OR REINDEX?
September 17, 2008 at 7:05 am
As I said above, I'd do checkDB first, as there's little point in trying to rebuild indexes of a database with corruption. Also, it's very likely that the index rebuild would fail if there's corruption present.
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
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply