Skip to main content
edited body
Source Link

For example, we have the database "test" and we make a full backup every 24 hours, differential backup every 6 hours and backup your transaction log every hour. But for this schedule your database should run with full or bulk-logged recovery model. So, what should we do when the failure occurs? First of all, we have to restore our last full backup. Full database backup consists of a backup copy that containing all data files and active part of the transaction log.

RESTORE DATABASE test FROM DISK = 'd:/test.bak' WITH NORECOVERY, REPLACE

The Next step is to restore the last differential database backup, that containing all changes made to the database since the last full backup and active part of the transaction log.

RESTORE DATABASE test FROM DISK = 'd:/test_diff.bak' WITH NORECOVERY

And finally we can restore all transaction log backups. Transaction log backup contains all log records that haven’t been backed up, up to the last log record that exists at the time of backup completion. We have to restore all transaction log backups that have been made after the last differential backup according to their log sequence number.

RESTORE LOG test FROM DISK = 'd:/test_log59.bak' WITH NORECOVERY
RESTORE LOG test FROM DISK = 'd:/test_log60.bak' WITH NORECOVERY

And the last one

RESTORE LOG test FROM DISK = 'd:/test_log59test_log61.bak' WITH RECOVERY

For example, we have the database "test" and we make a full backup every 24 hours, differential backup every 6 hours and backup your transaction log every hour. But for this schedule your database should run with full or bulk-logged recovery model. So, what should we do when the failure occurs? First of all, we have to restore our last full backup. Full database backup consists of a backup copy that containing all data files and active part of the transaction log.

RESTORE DATABASE test FROM DISK = 'd:/test.bak' WITH NORECOVERY, REPLACE

The Next step is to restore the last differential database backup, that containing all changes made to the database since the last full backup and active part of the transaction log.

RESTORE DATABASE test FROM DISK = 'd:/test_diff.bak' WITH NORECOVERY

And finally we can restore all transaction log backups. Transaction log backup contains all log records that haven’t been backed up, up to the last log record that exists at the time of backup completion. We have to restore all transaction log backups that have been made after the last differential backup according to their log sequence number.

RESTORE LOG test FROM DISK = 'd:/test_log59.bak' WITH NORECOVERY
RESTORE LOG test FROM DISK = 'd:/test_log60.bak' WITH NORECOVERY

And the last one

RESTORE LOG test FROM DISK = 'd:/test_log59.bak' WITH RECOVERY

For example, we have the database "test" and we make a full backup every 24 hours, differential backup every 6 hours and backup your transaction log every hour. But for this schedule your database should run with full or bulk-logged recovery model. So, what should we do when the failure occurs? First of all, we have to restore our last full backup. Full database backup consists of a backup copy that containing all data files and active part of the transaction log.

RESTORE DATABASE test FROM DISK = 'd:/test.bak' WITH NORECOVERY, REPLACE

The Next step is to restore the last differential database backup, that containing all changes made to the database since the last full backup and active part of the transaction log.

RESTORE DATABASE test FROM DISK = 'd:/test_diff.bak' WITH NORECOVERY

And finally we can restore all transaction log backups. Transaction log backup contains all log records that haven’t been backed up, up to the last log record that exists at the time of backup completion. We have to restore all transaction log backups that have been made after the last differential backup according to their log sequence number.

RESTORE LOG test FROM DISK = 'd:/test_log59.bak' WITH NORECOVERY
RESTORE LOG test FROM DISK = 'd:/test_log60.bak' WITH NORECOVERY

And the last one

RESTORE LOG test FROM DISK = 'd:/test_log61.bak' WITH RECOVERY
Source Link

For example, we have the database "test" and we make a full backup every 24 hours, differential backup every 6 hours and backup your transaction log every hour. But for this schedule your database should run with full or bulk-logged recovery model. So, what should we do when the failure occurs? First of all, we have to restore our last full backup. Full database backup consists of a backup copy that containing all data files and active part of the transaction log.

RESTORE DATABASE test FROM DISK = 'd:/test.bak' WITH NORECOVERY, REPLACE

The Next step is to restore the last differential database backup, that containing all changes made to the database since the last full backup and active part of the transaction log.

RESTORE DATABASE test FROM DISK = 'd:/test_diff.bak' WITH NORECOVERY

And finally we can restore all transaction log backups. Transaction log backup contains all log records that haven’t been backed up, up to the last log record that exists at the time of backup completion. We have to restore all transaction log backups that have been made after the last differential backup according to their log sequence number.

RESTORE LOG test FROM DISK = 'd:/test_log59.bak' WITH NORECOVERY
RESTORE LOG test FROM DISK = 'd:/test_log60.bak' WITH NORECOVERY

And the last one

RESTORE LOG test FROM DISK = 'd:/test_log59.bak' WITH RECOVERY