Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2002
    Posts
    1

    Exclamation Unanswered: Help !!! We lost LDF file !

    How can we restore DB without LDF file ?

    We try ...

    EXEC sp_attach_single_file_db @dbname = 'Ascue_10',
    @physname = 'C:\temp\Ascue_10_Data.MDF'

    ______________________________________


    Server: Msg 945, Level 14, State 2, Line 1
    Database 'Ascue_10' cannot be opened because some of the files could not be activated.
    Server: Msg 1813, Level 16, State 2, Line 1
    Could not open new database 'Ascue_10'. CREATE DATABASE is aborted.

    Please Help !!!

  2. #2
    Join Date
    Aug 2002
    Posts
    11
    If you do not want the log file SQL will automaticall create one for you when you attach a database in the same loc as the mdf file.
    Try this,
    sp_attach_db test,
    N'c:\program files\microsoft sql server\mssql\data\test_data.mdf'.
    You still will get an activation error but the database can be used with the new log file created.
    Hope this helps
    Anup

  3. #3
    Join Date
    Sep 2006
    Posts
    13
    Hello,

    I tried to attach my MD and or work with the stored procedures but always it is complaining about the log file which is not able to create...

    I tried two options but none is working !!!
    EXEC sp_attach_db @dbname = N'AeXNS_Data',
    @filename1 = N'E:\AeXNS_Data.mdf',
    @Filename2 = N'F:\AeXNS_Log.LDF'
    Server: Msg 5105, Level 16, State 4, Line 1
    Device activation error. The physical file name 'F:\AeXNS_Log.LDF' may be incorrect.


    EXEC sp_attach_single_file_db @dbname = N'AeXNS_data',
    @physname = N'E:\AeXNS_Data.mdf'

    Server: Msg 1813, Level 16, State 2, Line 1
    Could not open new database 'AeXNS_data'. CREATE DATABASE is aborted.
    Device activation error. The physical file name 'F:\AeXNS_Log.LDF' may be incorrect.

    But there is no file with that name AeXNS_Log.LDF as I want to create it from scratch...

    Any ideas?

    Thanks,
    Dom
    __________________

  4. #4
    Join Date
    Sep 2006
    Posts
    5
    What is a LDF file?

  5. #5
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Dom ... sounds familiar ... have you checked the F:\ drive to ensure the file it is trying to create does not exist?

    ck ...ldf = log data file ... not to be confused with MDF or NDF.

    -- This is all just a Figment of my Imagination --

  6. #6
    Join Date
    Sep 2006
    Posts
    13
    yes I checked C, E and F there is no log files on any drive...

  7. #7
    Join Date
    May 2006
    Posts
    38

    Smile

    /*You need to execute "sp_attach_single_file_db" for MSSQL to create the log file

    For example if yu want to create a database called rantest with just the MDF file ..you need to execute sp_attach_single_file_db as


    EXEC sp_attach_single_file_db @dbname = 'rantest',
    @physname = 'C:\MSSQL2000\SQLDATA\MYLONEMDF_data.mdf'

    A new ldf file will be created in the same path as the MDF. Dont worry about the all the warnings and errors.Refresh it and yu should get back yur database complete with all tables and stored procedures !!



    Regards,
    -Ranjit. */

    Commenting it out .. Looks like yu've already tried this option

Posting Permissions

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