question

ebzm avatar image
ebzm asked

Rebuild Index Problem

Can you please help shed some light on rebuilding an index and severe error and disconnect? Why and any work around for it? THANK YOU. ALTER INDEX [IX_ATTR_ENTITY_ID] ON [ISII].[dbo].[ATTRIBUTE] REBUILD WITH (SORT_IN_TEMPDB = OFF, ONLINE = ON) Getting the following error:- The statement has been terminated. The statement has been terminated. Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. Msg 0, Level 20, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. IndexType: NonClustered, LOB: No, AllowPageLocks: Yes, PageCount: 1405756, Fragmentation: 70.2575
index
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Magnus Ahlkvist avatar image
Magnus Ahlkvist answered
Run a DBCC CHECKDB and see if there are inconsistencies and/or other errors in the database.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sharma avatar image
Sharma answered
I agree with Margnus, for check corruption you can also run DBCC CHECKTABLE for table on which you are trying to rebuild index also you can try to drop and recreate index.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Srishiva avatar image
Srishiva answered
;lkasjd;ipoh;lik;lk
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Magnus Ahlkvist avatar image Magnus Ahlkvist commented ·
Are you really sure? :)
2 Likes 2 ·
Håkan Winther avatar image
Håkan Winther answered
I agree with Magnus, run DBCC CHECKDB. You can also try to use CREATE INDEX and specify the option DROP_EXISTING=ON if it's not the clustered index. If you have corruption in a regular index (not the clustered index), you will get rid of the corruption when the index is dropped and recreated without any dataloss. On the other hand if it's the clustered index, you'll probably get dataloss. Anyway, you should use a frequent routine to check for corruption in your database to prevent any dataloss.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Blackhawk-17 avatar image
Blackhawk-17 answered
You could also try running it with ONLINE = OFF.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.