restore point of time

  • When we run the point of time restore, for example if we ran transaciton backup every 3 hours.

    for example we did a transaction backup at 12:00pm let's call it Trans1 and next transaction is 3:00 pm - name trans2.

    I need 1, the full backup, 2. the differencial backup, 3. for the transaction backup.

    My quesiton is for 3, if I want to restore to 12:50 pm, do I use Trans2 file and, the restore will exactly goes to 12:50 or it goes to 3:oo pm?

    Thanks

  • declare @stopat datetime

    set @stopat = {ts'2011-01-01 12:50:00'}

    restore database blah from disk = 'blah.bak' with replace, norecovery

    restore database blah from disk = 'blah.diff' with norecovery

    restore log blah from disk = 'blah1.trn' with stopat = @stopat -- equivalent to "with norecovery" if log ends before this time

    restore log blah from disk = 'blah2.trn' with stopat = @stopat -- will stop at 12:50 // all uncommitted transactions in the log at that time will be rolled back

    assuming blah.diff was created before 12:50 ...

  • Thanks, got it.

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

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