How to recover my user database if LDF is lost?

  • Thanks Grieg. 🙂 I am convinced with your real example!!!

  • Hello Abhay and others

    Thanks for putting up your expert comments.

    Could you please clarify the below concern?

    If the .LDF is gone, what are the steps required to follow to recover the database if I am using SQL 2005 and 2008?

    Regards

    Sourav

    Thanks.

  • Sourav Mukherjee (7/12/2009)


    If the .LDF is gone, what are the steps required to follow to recover the database if I am using SQL 2005 and 2008?

    Restore from backup. If you have no backup, then

    http://sqlinthewild.co.za/index.php/2009/06/09/deleting-the-transaction-log/

    Note that while the attach_force_rebuild_log does work, it is not documented and not recommended. Emergency mode repair is.

    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
  • mmmm

    exec sp_attach_single_file_db 'MYDATABASENAME',

    'PATH and NAME DATABASE FILE'

    Example:

    exec sp_attach_single_file_db 'test',

    'c:\test.mdf'

  • andresysbl (7/13/2009)


    mmmm

    exec sp_attach_single_file_db 'MYDATABASENAME',

    'PATH and NAME DATABASE FILE'

    Example:

    exec sp_attach_single_file_db 'test',

    'c:\test.mdf'

    Deprecated in SQL 2005, will be removed in a future version. Rather use CREATE DATABASE ... FOR ATTACH or CREATE DATABASE ... FOR ATTACH_REBUILD_LOG

    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

Viewing 5 posts - 31 through 34 (of 34 total)

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