Recovering From Corrupted Filegroup Files

  • I had a database that filled all the designated files in the data filegroup. I added four new empty files with to the filegroup to expand the database. I then made a mistake and ended up corrupting the last two files in the filegroup. These two corruptd files have no data so I want to eliminate them from the filegroup, but the database is in an off-line state because of the corruption. I detached the database, and tried to reattach it, but it says it can't find the two files that are corruipted.

    How can I modify the database to ignore these corrupt files, so that I can bring the database back online? Short of that, how can I rebuild the database from scratch and then import the existing data from the offline database?

    Any ideas on how to approach this problem would be appreciated.

    Brandon_Forest@sbcglobal.net

  • Outside of using 3rd party software, I not sure if you can re-attach a database that has corrupted files in SQL Server

    Easiest thing I would recommend would be to restore your database from you backups. That would get it up and running quickly.

    After that, then try adding the file groups again. If you corrupt the database again, don't detach it. Do a tail log backup and then do a page restore to restore to a point before the database was corrupted.

  • How did you manage to corrupt the files? Short of taking a hex editor to them, it shouldn't be possible for you to corrupt a file.

    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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • http://www.nigelrivett.net/SQLAdmin/RecoverCorruptDatabase.html

    http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/18/636105.aspx

    Backups would obviously be the better choice here. Hopefully the two links help.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply