Determine the Log Backup Order

  • Hello Everyone

    I am trying to determine the order Log backups.

    I am taking a Full backup, and then a Differential backup, and then multiple Transaction Log backups. Then I would like to restore the backups via T-SQL. How would I know what the order of the Log backups. I need to know that before I can ever restore everything to a point in time.

    Thanks

    Andrew SQLDBA

  • You can use the backup_set_id column in the backupset table in msdb. There are scripts available that can be used to generate the restore script for you.

    Search this site and google and you'll find plenty of hits.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • RESTORE HEADERONLY also grabs the LSN. Those are linked together.

    If you use the GUI and do it on the same machine, the backups are stored. If you are doing this in DR, you have to use a script to find them.

    The other thing I've always done is use naming convention that includes date/time information so that I know what order things were made in.

  • Is it not possible to find that from file created datetime??

  • It is, unless the files get copied to a new server. New creation date. That's why I use naming conventions.

    Most scripts, and the maint plans, will do this for you.

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

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