Attach .mdf without .ldf

  • hello all.

    I have .mdf and .ldf file but .ldf was damaged when I try to attach this data base with out .ldf with this 3 method:

    ------method1

    USE [master]

    GO

    CREATE DATABASE [eOrganization] ON

    (FILENAME = N'E:\Farzin\Database\eOrganization.mdf')

    FOR ATTACH_REBUILD_LOG

    GO

    -----method2

    USE [master]

    GO

    CREATE DATABASE [eOrganization] ON

    ( FILENAME = N'E:\Farzin\Database\eOrganization.mdf' )

    FOR ATTACH

    GO

    --------method3

    USE [master]

    GO

    -- Method 1: I use this method

    EXEC sp_attach_single_file_db @dbname='eOrganization',

    @physname=N'E:\Farzin\Database\eOrganization.mdf'

    GO

    ------

    I got this errors:

    Msg 1813, Level 16, State 2, Line 1

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

    Msg 1813, Level 16, State 2, Line 1

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

    Msg 3456, Level 21, State 1, Line 1

    Could not redo log record (150978:161:48), for transaction ID (0:12118066), on page (1:94206), database 'eOrganization' (database ID 5). Page: LSN = (150974:24:3), type = 1. Log: OpCode = 2, context 1, PrevPageLSN: (150976:147:3). Restore from a backup of the database, or repair the database.

    Msg 3313, Level 21, State 2, Line 1

    During redoing of a logged operation in database 'eOrganization', an error occurred at log record ID (150978:161:48). Typically, the specific failure is previously logged as an error in the Windows Event Log service. Restore the database from a full backup, or repair the database.

    I don't have any back up from this data base and I have to attach this .mdf.

    please guide me how to solve this problem because this is customer's data base and the customer is so important.

  • in addition to my post:

    I don't know at all how to create a suspect database..when I searched it I didn't get how to do this?

  • A database requires both a data file and a log file. If you don't have a backup you might not get very far.

    What happens when you try to attach the data file with the log file? (I know you say the ldf is damaged, but what are the symptoms?)

  • elham_azizi_62 (5/27/2015)


    in addition to my post:

    I don't know at all how to create a suspect database..when I searched it I didn't get how to do this?

    Repairing a suspect DB? I think this is what you are asking?

    http://www.sqlskills.com/blogs/paul/creating-detaching-re-attaching-and-fixing-a-suspect-database/

    This might help.

    Good luck.

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

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