Backup and log files

  • I am a newby here.

    My data was destroyed and I was able to find another backup on a drive.

    I do have a complete database from January. However, I have two additional files that do not show with a file extension. One for each of the following months. I think these are log files that were backed up.

    Is there any way to use these "log" files to recover and append to the existing data from a few months ago? Or are these worthless without a more recent data file portion?

    How would I find out?

    Thanks

     

     

    Attachments:
    You must be logged in to view attached files.
  • Can you include the file sizes in the screen shot?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • I copied and change the name of one of the files to see if it would be recognized.

    Attachments:
    You must be logged in to view attached files.
  • The easiest way to find out is to try it.  You won't break the database by attempting to restore a backup from the wrong place in the chain - it'll just give an error message.

    -- Add WITH MOVE options to the first statementif the database file paths have changed,
    -- or WITH REPLACE if you're overwriting a database that already exists
    RESTORE DATABASE MyDB FROM DISK = 'D:\NAV (9-0) Daily Backups\01_16_2020.bak' WITH NORECOVERY;
    RESTORE LOG MyDB FROM DISK = 'D:\NAV (9-0) Daily Backups\01_16_2020_Log.trn' WITH NORECOVERY;
    RESTORE LOG MyDB FROM DISK = 'D:\NAV (9-0) Daily Backups\020720' WITH NORECOVERY;
    RESTORE LOG MyDB FROM DISK = 'D:\NAV (9-0) Daily Backups\03262020' WITH NORECOVERY;
    RESTORE LOG MyDB FROM DISK = 'D:\NAV (9-0) Daily Backups\03262020.bak.txt' WITH NORECOVERY;

    You can also use RESTORE HEADERONLY to see what backup (if any) is in any particular file.  If you have an understanding of LSNs, you'll be able to use that information to know whether a particular log backup can be restored on top of a particular full backup.

    When this is all done, implement a proper backup strategy, and make sure you do regular test restores.

    John

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

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