DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Attach a database without the corrupted log file

  1. #1
    Join Date
    May 2015

    Attach a database without the corrupted log file

    Im asking if it possible that a attach a .MDF datafile without the .LDF
    I want that because i have a corrupted Log file nd when i attach the database raise the following error:-
    The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure.
    I just need the data file This what i need and i dont need the corrupted Log file any more
    i tried
    sp_attach_single_file_db 'new_2009', 'C:\Data\new_2009_Data.MDF'
    but the same error comes up.
    Please note i have no recent backup so dont suggest to restore the database from backup

  2. #2
    Join Date
    Nov 2000
    Pittsburgh, PA
    You should know that this is a website devoted to Oracle databases, not SQL Server
    databases. So your post is off topic. however, it seems to be possible. This should
    help you to get started.


  3. #3
    Join Date
    May 2015
    Stop SQL Server instance -> Copy MDF and LDF files to another location -> Delete original MDF and LDF files -> Start SQL Server instance again -> Create new database with exact same name and file names -> Stop SQL Server -> overwrite newly created MDF and LDF.

    After this your database should be back online. If it is then go ahead and put it into EMERGANCY mode and SINGLE USER mode.

    Finally go ahead and execute DBCC CHECKDB like this


    Guide above might be not effective, in such case use software for corrupted sql data https://www.repairtoolbox.com/sqlserverrepair.html SQL Server Repair Toolbox

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