Restore Database from Backup

In that article let’s explore one of the several major elements in the daily life of every DBA. This is SQL Server restore database from backup process. If you are looking for the best and the easiest way to restore database from backup is to apply the simple software – One-Click Restore. You can install this simple tool on your machine or desktop computer and restore your database automatically quickly. However beneath let’s explore the other techniques of database restoration.

Restore Database from Backup

In this a portion of our review, we are going to show two ways how to restore database from backup, there are simple T-SQL Commands, SSMS (SQL Server Management Studio) and backup tool One-Click Restore.

How to restore database from backup using T-SQL Commands

It’s well known that there are three types of SQL Server database backups – full, differential and transaction log backups.

How to restore database from full backup

Apply the following T-SQL Command to restore the full backup of your SQL Server database. That backup will overwrite your database if such is exist or produce a new SQL Server database.

RESTORE DATABASE Adventureworks FROM DISK = 'D:Adventureworks_full.bak'

Once you have restored your full database backup you can restore a differential or transaction log backups. If you need to do it, restore your full backup using NORECOVERY command. This particular command leaves a backup on restoring state and assists you to restore extra differential or transaction log backups.

RESTORE DATABASE Adventureworks FROM DISK = 'D:Adventureworks_full.bak'
How to restore database from differential backup

The T-SQL Command to restore the differential backup is similar as the Command to restore a full backup. All you have to do is don’t skip to add NORECOVERY command.

RESTORE DATABASE Adventureworks FROM DISK = 'D:Adventureworks_full.bak' WITH NORECOVERY
GO
RESTORE DATABASE Adventureworks FROM DISK = 'D:AdventureWorks_diff.dif'
GO
How to restore database from transaction log backup

If you need to restore a transaction log backup, please don’t forget, that your SQL Server database should be in the restoring state. Which means that it is needed to restore a full backup and a differential backup, if it needed, earlier.

RESTORE LOG Adventureworks FROM DISK = 'D:Adventureworks_log.trn'
How to restore database from multiple transaction log files using NORECOVERY option

As we discussed just before you require to add NORECOVERY command to set the database in a restoring state. Under, you will find out the case how to restore your SQL Server database with the help of the next restore scenarios:

RESTORE DATABASE Adventureworks FROM DISK = 'D:Adventureworks_full.bak' WITH NORECOVERY
GO
RESTORE DATABASE Adventureworks FROM DISK = 'D:Adventureworks_diff.dif' WITH NORECOVERY
GO
RESTORE LOG Adventureworks FROM DISK = 'D:Adventureworks_log1.trn' WITH NORECOVERY
GO
RESTORE LOG Adventureworks FROM DISK = 'D:Adventureworks_log2.trn' WITH RECOVERY
GO

How to restore database from backup using SQL Server Managment Studio

Just below we will cover how to restore SQL database from backup using SSMS (SQL Server Management Studio).

1. Go online to your SQL Server and right-click on the “Database” directory and choose “Restore Database”.
2. Click the button beneath the “Source” section next to “Device”.
3. In the “Select backup device” press “Add”.
4. Select the backup file or files (.bak) you are going to restore.
5. In the “Restore Database” window specify the database’s name you will restore and click “Ok” to start.
There you have it. Your SQL Server database is restored!

How to restore database from backup using One-Click Restore

If you should have immediately restore SQL database from backup (full backup), then the most convenient method is to choose simple utility One-Click Restore. All you need to do is to select a .bak or .zip backup file and select a database where you want to restore it.Restore Database from Backup

[Total: 1    Average: 5/5]

Leave a Reply

Your email address will not be published.