Solved

rebuild does not fix NC index error

Posted on 2013-01-22
5
464 Views
Last Modified: 2013-01-23
my understanding is NC index can be easily fixed in data corruption.. but what may block easy rebuild of such a case?
0
Comment
Question by:25112
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 5

Author Comment

by:25112
ID: 38806047
Table error: table 'OptionsReview' (ID 329820287). Data row does not have a matching index row in the index 'NdxOptionsReviewA' (ID 3). Possible missing or invalid keys for the index row matching:
Msg 8955, Level 16, State 1, Line 2
Data row (1:98012:58) identified by (HEAP RID = (1:98012:58)) with index values 'OptionsReviewID = 4146 and HEAP RID = (1:98012:58)'.

NdxOptionsReviewA is a non-clustered non-unique index on OptionsReviewID.

I rebuilt the index NdxOptionsReviewA, but I still get the same error when I run dbcc checkdb or checktable.
0
 
LVL 5

Author Comment

by:25112
ID: 38806095
The funny thing is if I run DBCC CHECKTABLE (OptionsReview) then I get the below:

DBCC results for 'OptionsReview'.
There are 217112 rows in 2332 pages for object "OptionsReview".
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

but
DBCC CHECKDB (POPT) WITH NO_INFOMSGS, ALL_ERRORMSGS
brings back the same errors for this table.
0
 
LVL 5

Author Comment

by:25112
ID: 38806154
i dropped the index and then there is no errors with
DBCC CHECKDB (POPT) WITH NO_INFOMSGS, ALL_ERRORMSGS for that table..

but i recreate that index, then i get the error back.

does that mean the problem is data and not index even though the error message seems to indicate so? what would you recommend for this?
0
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 500 total points
ID: 38807926
Heaps can become so "scattered" over time that it can cause issues.

If the table is not too large / can afford the down time (or you have Enterprise+ edition and can do the index changes ONLINE), I'd suggest you try this:

1) Review sys.dm_db_index_usage_stats for that table and see if any NC index could make a good Clus index.
2) Script out all existing NC indexes.
3) Drop all NC indexes.
4) Create a clustered index.
5) OPTIONAL: Drop the clustered index.
6) Recreate all NC indexes, unless that key(s) became the clustered index.
0
 
LVL 5

Author Comment

by:25112
ID: 38810643
100% Right on..thanks Scott..

create CI once did it.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question