Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    2

    Unanswered: Need urgent help - Only MDF!

    hi ,
    My second hd got some problem and do not showing anymore... datacenter is checking it...

    but the problem is.
    now i only have MDF files.

    how can i restore my database without ldf?

    omg i'm afraid.
    sorry my bad english

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    You can restore the database from backup, and restore the log to the good drive, until a new drive comes along, or the old one gets fixed.

    If you have no backups you should make a copy of the .MDF file immediately. Anything else I suggest will make changes to this file. Once you have a copy of the .MDF file, you can try to attach it to the SQL Server instance, so long as there were no transactions "in flight" while the disk went bad.
    Code:
    sp_attach_single_file_db testdb, 'full path to your copy of the .MDF file'

  3. #3
    Join Date
    Apr 2010
    Posts
    2
    i'm execute it and receive this error

    File activation failure. The physical file name "D:\db\lin2world_log.ldf" may be incorrect.
    The log cannot be rebuilt because the database was not cleanly shut down.
    Msg 1813, Level 16, State 2, Line 1
    Could not open new database 'testdb'. CREATE DATABASE is aborted.

    so?
    omg

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Yep. Looks like the only options are hope that the disk the logs were on comes back, or restore from backup.

Posting Permissions

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