Time given lies in all three backups, full, diff ,log:
- full - 12 midnight
- diff - 4 am ( every 4 hours)
- log - 15 minutes interval
- time restore is 5:17
- time restore is 5:14
How should I answer that?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
I'd answer that from the
backupset tables. Build the restore T-SQL dynamically from that using
STOPAT for the time you want to restore.
Use PowerShell + dbatools
pipe get-backuphistory to
restore-database using the
Your question is bit unclear; you have not specified whether there was a failure and at which time the failure happened.
In general, restore steps are:
i.e. in above scenario:
restore full backup that was taken at midnight with no recovery
the diff backup taken at 4am with norecovery
restore all t-log backups until 5.15 with no recovery
restore t-log backup taken at 5.30 with stop at 5.17 and with recovery
For 5:14, do step 1, do step 2, step 3 all t-log backups till 5am with no recovery. Then restore t-log backup taken at 5.15 with stop at 5.14 with recovery.