Restore Database

MSSQL-Feature-Image

We will use the backup files which set up at “Setup a backup file for restore“.
Restore Backup file in the following order:
1. The most recent “Full Backup”
2. The most recent “Differential Backup”
3. All “Log Backup” in chronological order

“WITH NORECOVERY”
1. All restore except the last one must contain this.
2. Roll back will not occur.
3. Roll forward allows to continue.

“WITH RECOVERY”
1. The last restore should contain this.
2. Roll back will occur.
3. Roll forward is completed.

“WITH REPLACE”
1. If we does not take a tail log backup before the restore, the error will raised.
2. We can use “WITH REPLACE” or take a tail log to solve this error.

Restore from a full backup:
We will restore DB to 2nd Full backup

Restore from a different backup:
We will restore DB to 2nd differential backup

Restore from a log backup:
We will restore DB to 5th log backup

Restore to special point of time:
We will restore to ‘2019-08-11 17:33:38’

Restore from backup to other Database:
We will restore 4th Log backup to DB named “HELLO”

Author: Joe Chan