Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2004
    Location
    Italy
    Posts
    7

    Unanswered: restore database from ldf file only

    Hello guys,
    is it possible to restore an SQL server database from the .ldf file only?

    The last operation is a script execution that have drop and create all the tables.

    have you some idea?

    Thanks to all

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    ldf typically contains only logs, which record changes to the database. Any restore must begin by reloading a backup, followed by whatever logs are required/desired.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Apr 2004
    Location
    Italy
    Posts
    7
    thanks for the fast reply.

    I have an old backup that is from december, and the log file that is till now.

    Do I have some chance?

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Yes, if you have continuous logs.

    You can certainly restore the backup from December. If your logs are continuous since then, then you can do a point in time restore. Your best bet is to do it using Enterprise Manager, assuming that it has kept a record of backups and log dumps.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    First check if your database has been in FULL recovery mode. If it is set to SIMPLE than you don't stand a chance.

    The simplist way to check this is in EM. Look at the properties of the database, tab "options".

  6. #6
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Quote Originally Posted by Lexiflex
    First check if your database has been in FULL recovery mode. If it is set to SIMPLE than you don't stand a chance.

    The simplist way to check this is in EM. Look at the properties of the database, tab "options".
    I could wrong but I do not think you can even back up the log in SIMPLE.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  7. #7
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    Nope you can't. And even if you could there wouldn't be anything of use to you in there.

    But it sounds like they didn't backup logs, there's only talk about a full backup. So if there are no log backups and the database is in FULL recovery mode (that ldf file could be huge!) he could try a restore with a roll forward (I think that's the theory, never done it before).

    Who is it that has that nice tag line: "did you hug your backup today?"

    Lex

Posting Permissions

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