sql 2005 , attach mdf only as ldf was lost need to rebuild log , How to do in sql 2005?

  • Good day all.

    I lost a drive due to some hardware fault.

    My log files were on the faulty drive.

    i do not have access to a backup now.

    i have the mdf file though,

    The ldf files are gone.

    Can i attach in sql 2005 to a single mdf file

    The DB was not detached clean,

    i tried the

    exec sp_attach_single_file_db 'XXX','H:\AAA\xxx.mdf'

    Msg 5173, Level 16, State 1, Line 1

    One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup.

    Log file XXX.ldf' does not match the primary file. It may be from a different database or the log may have been rebuilt previously.

    Msg 5173, Level 16, State 1, Line 1

    One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup.

    File activation failure. The physical file name "xxx.ldf" may be incorrect.

    Msg 1813, Level 16, State 2, Line 1

    Could not open new database 'XXX'. CREATE DATABASE is aborted.

    i also cant rebuild the log as that feature is not in sql 2005,

    Please if someone had this problme , how did you get around, i need to attach my mdf , without ldf .

  • Duplicate post, responses to:

    http://qa.sqlservercentral.com/Forums/Topic859597-146-1.aspx

    Steve Hall
    Linkedin
    Blog Site

  • sorry i posted it here, but then seen it was categorised as a performance tuning thing, so i reposted,

    havent posted before here.?

Viewing 3 posts - 1 through 2 (of 2 total)

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