locked
Rebuilding a corrupt table RRS feed

  • Question

  • Last week we had one our databases get corrupted and restoring from a backup wasn't an option, so I ran DBCC checktable and fixed the 4 corrupt tables but lost some data. I was easily able to put 3 of the 4 back to where they should be but the 4th table is around 440 million rows. I am currently using BULK IMPORT to load the data from a backup and it is SUPER slow. Any suggestions for getting this table restored? I thought about using SELECT INTO and rename the table after it is good but I thought adding the indexes would take a long time too.

    Thanks!

    Wednesday, May 18, 2016 4:08 PM

Answers

  • There can be many reasons for slowness, does destination table has many indexes ?

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    • Marked as answer by nickswoca Wednesday, May 18, 2016 5:06 PM
    Wednesday, May 18, 2016 4:48 PM

All replies

  • There can be many reasons for slowness, does destination table has many indexes ?

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    • Marked as answer by nickswoca Wednesday, May 18, 2016 5:06 PM
    Wednesday, May 18, 2016 4:48 PM
  • It might be better to drop the indexes (both clustered and nonclustered) and do the data import and recreate the indexes later.

    atleast this way you have data you need in your table and applications can use it.

    I typically, use SSIS - fast data upload option the in data flow task and copy the data and then rebuild the indexes.


    Hope it Helps!!

    Wednesday, May 18, 2016 4:51 PM
  • I went ahead and removed the indexes and it is moving much faster.  I thought I had done that but I was looking at the table on Test...doh!

    Thanks!

    Wednesday, May 18, 2016 5:06 PM
  • you can choose any of the method from this article: http://www.sqlmvp.org/table-level-recovery-for-selected-tables/


    Thursday, May 19, 2016 5:35 AM