Can't restore differentials from backupset

  • Hi All
    I can’t figure out why I can’t restore the differential backup.  I have verified that it’s from the correct backupset but it’s still giving me an error that .  I’m posting the header info and the code I’m using to restore below:


    FILEPATH                                                  FIRSTLSN                LASTLSN                  DATABASEBACKUPLSN
    FILEPATH\FULLS\db_201704232155_COMPRESSED.BAK     775961000006058400196      775962000003906000001      775959000008533600042                Full
    FILEPATH \DIFFS\db_201704231901_DIFF_COMPSD.DIF      775960000020287200048      775960000020420900001      775959000008533600042      Differential


    RESTORE DATABASE dbxxx
    FROM DISK = 'FILEPATH\FULLS\db_201704232155_COMPRESSED.BAK'
    WITH
           REPLACE,
           NORECOVERY,
           STATS = 5

    RESTORE DATABASE dbxxx
    FROM DISK = 'FILEPATH \DIFFS\db_201704231901_DIFFERENTIAL_COMPRESSED.DIF'
    WITH RECOVERY, STATS = 5

    Processed 14654 pages for database 'dbxxx', file 'dbxxx_log' on file 1.
    RESTORE DATABASE successfully processed 9627398 pages in 137.872 seconds (545.535 MB/sec).
    Msg 3136, Level 16, State 3, Line 49
    This differential backup cannot be restored because the database has not been restored to the correct earlier state.
    Msg 3013, Level 16, State 1, Line 49
    RESTORE DATABASE is terminating abnormally.

    Can anyone see what I'm doing wrong?

    Thanks

    Cathryn

  • It looks like the FULL backup is from after the DIFF was taken.  You'd need to use the full from before the diff.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Yup, your diff was created prior to your full. You can't go backwards.

  • Oh geez...ok.  You're right.  Thank you:crazy:

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

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