Using Differentials to set up mirroring

  • Ive set up mirroring many times with a full backup and a log backup or two.

    Someone mentioned recently that you can set it up using a full backup, diff backup and any tran logs since the diff backup.

    But this does not make senese to me as diff backups dont advance the log chain. I assumed that if i took a diff backup, and then took a log backup, they would both start from the same point. is that incorrect?

  • I've never tried with a differential backup, but it makes sense that it should work: See the following from http://msdn.microsoft.com/en-us/library/ms187495.aspx:

    1.Back up the active transaction log (known as the tail of the log). This creates a tail-log backup. If the active transaction log is unavailable, all transactions in that part of the log are lost.

    2.Restore the most recent full database backup without recovering the database (RESTORE DATABASE database_name FROM backup_device WITH NORECOVERY).

    3.If differential backups exist, restore the most recent one without recovering the database (RESTORE DATABASE database_name FROM differential_backup_device WITH NORECOVERY).

    Restoring the most recent differential backup reduces the number of log backups that must be restored.

    4.Starting with the first transaction log backup that was created after the backup you just restored, restore the logs in sequence with NORECOVERY.

    5.Recover the database (RESTORE DATABASE database_name WITH RECOVERY). Alternatively, this step can be combined with restoring the last log backup.

    Apart from step 5, this is where you want to be at when setting up the partner...

  • That will work fine, but the only reason you'd do it is if there have been lots and lots of log backups since the full backup you used was taken and you don't want to have to restore all of those log backups.

    You'd then use the full backup, the diff backup and all the log backups taken since the differential backup. It can be faster if you have many, many log backups to restore otherwise.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • winston Smith (4/11/2013)


    Ive set up mirroring many times with a full backup and a log backup or two.

    Someone mentioned recently that you can set it up using a full backup, diff backup and any tran logs since the diff backup.

    But this does not make senese to me as diff backups dont advance the log chain. I assumed that if i took a diff backup, and then took a log backup, they would both start from the same point. is that incorrect?

    To add to Gail, differential backups do advance the diff base LSN and hence are used in combination with log backups as Gail has mentioned.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

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

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