correpted mdf file

  • HI I have a old backup from my corrupted mdf file but the ldf is OK. Can I restore the DB

    Thanks anyway

  • Not sure - because I am not sure what you have available.

    Do you have a backup of the database?

    Do you have a backup of the transaction log?

    How old are the backups?

    Was the database setup in full recovery model?

    If the database was not in full recovery model, then there is nothing in the ldf (log) file to be recovered. If the database was in full recovery model and you don't have all of the transaction log backups, then there is nothing to restore either.

    Now, if you have never backed up the transaction log and it is in full recovery model you might be able to get those transaction backed up. Look in BOL at the topic tail-log backup.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Check your backup file using RESTORE VERIFYONLY option.

  • FOR SQL Server 2000

    -----------------------

    If your backup is corrupt irrespective of LDF or MDF , you cannot restore .

    If you have the LDF and MDF files but MDF corrupted , you cant do anything except : creating a same database >> swap the files >> take the database to emergency >> run DBCC checkdb and see what all is corrupt and if there is an option for repair_allow_data_loss.In any case you will be loosing some data .You will come to know what data is corrupt only after checkdb and can take the actions after that (like if the index/SP/indexed view/unimportant table is corrupt )

    If you have only LDF corrupted , you can rebuild it .

    FOR SQL Server 2005 :

    -----------------------

    In 2005 you have the option to restore a corrupt database backup using the option CONTINUE_AFTER_ERROR

    Later you can run checkdb on it to find out the corrupt objects and take actions thereafter.

    Abhay Chaudhary
    Sr.DBA (MCITP/MCTS :SQL Server 2005/2008 ,OCP 9i)

  • aa2home (6/9/2009)


    HI I have a old backup from my corrupted mdf file but the ldf is OK. Can I restore the DB

    Thanks anyway

    Wouldn't be a good idea. Is this a critical database?

    HI I have a old backup from my corrupted mdf file but the ldf is OK

    What you really meant by this? so the backup you have got is from your corrupted .mdf?

    If your database is corrupted and you have a good backup then it's better to restore it from there.

    If you have a corrupted backup, there are 2 options either you can restore it WITH CONTINUE_AFTER_ERROR or run DBCC CHECKDB and see what exactly is corrupted.

    It wouldbe great if you provide further information about your business too. Is your business ready to lose some data? the method you follow depends really on your business needs of the database.

  • thanks all of you

    I realy have problem with DB

    Evrething is wrong .... database was not in full recovery model and backup is old

    Any way

    The point of the matter is backup.. backup... backup....

  • aa2home (6/10/2009)


    thanks all of you

    I realy have problem with DB

    Evrething is wrong .... database was not in full recovery model and backup is old

    Any way

    The point of the matter is backup.. backup... backup....

    Yeah - you do have a problem. There is nothing in the transaction log to be backed up, so you cannot even perform a tail-log backup and hope it contains everything.

    The best you can do is restore the old backup - and accept the data loss. Sorry.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • aa2home (6/9/2009)


    HI I have a old backup from my corrupted mdf file but the ldf is OK. Can I restore the DB

    Thanks anyway

    Hi,

    What version of SQL server u are using-- 2000 or 2005 ?

    check this : http://www.sqlserverclub.com/articles/how-to-recover-from-a-corrupted-sql-server-database.aspx

    it is for 2000, but might give u an idea !!

    Hope this helps,

    \\K

    ______________________________________________________________________________________________________________________________________________________________________________________
    HTH !
    Kin
    MCTS : 2005, 2008
    Active SQL Server Community Contributor 🙂

  • OK boys that's it

    I restored an old backup and I accepted the lost data.

    thanks again....

  • aa2home (6/11/2009)


    OK boys that's it

    I restored an old backup and I accepted the lost data.

    thanks again....

    Glad, you found the solution.

    But you never answered the questions that I have posed?

  • I hope you noticed that this thread is 5 years old.

    -- Gianluca Sartori

  • spaghettidba (5/8/2014)


    I hope you noticed that this thread is 5 years old.

    So was that post. 🙂

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (5/8/2014)


    spaghettidba (5/8/2014)


    I hope you noticed that this thread is 5 years old.

    So was that post. 🙂

    Nope. I was referring to a post that Steve deleted today.

    It contained a misleading spam/ad link.

    -- Gianluca Sartori

Viewing 13 posts - 1 through 12 (of 12 total)

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