How to restore a database using mdf and ldf files in Sql 2008
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: How to restore a database using mdf and ldf files in Sql 2008

  1. #1
    Join Date
    Sep 2015
    Posts
    1

    How to restore a database using mdf and ldf files in Sql 2008

    Hello,

    Asking for expert opinion. A very unfortunate event happened. One of our PCs crashed few days ago. That PC had SQL Server 2008 installed. Unfortunately no backup was running on that server. We sent the disk to a data recovery place and looks like they can recover some of the mdf and ldf files. We are particularly interested in 1 particular database. My questions are:

    1. Is this possible to restore a particular database using corresponding mdf and ldf files?
    2. Do we need to have any mdfs from the system databases? Any other files we need to ask data recovery company t look for?
    3. Steps and/or or best practices to restore that database into a new machine.

    Thanks for your help in advance.

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,112
    I'm not sure why you put a SQL Server post on an Oracle site, but maybe someone can help.
    Using a recovery company to recover database files, seems problamatic to me. There is really
    no replacing a good backup strategy. But I don't know that it won't work. You should probably
    get the system database, although I am not sure that you absolutely need it.
    this space intentionally left blank

  3. #3
    Join Date
    Sep 2015
    Posts
    1
    Assuming the recovered MDF and LDF files are both healthy, then you can just use the following command to restore the database:

    sp_attach_db "database_name" "yourfile.ldf" "yourfile.mdf"

    See https://msdn.microsoft.com/en-us/lib...ql.100%29.aspx for more detailed info.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width