未加星标

SQL Server Restore Database from Backup

字体大小 | |
[数据库(mssql) 所属分类 数据库(mssql) | 发布者 店小二03 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏
[Total: 1 Average: 5/5]

SQL Server restore database from backup how to do it? This is one of the crucial questions related to SQL Server. In this article, we are going to show you two ways how you can do it. The first and the easiest way to make SQL Server database from backup is to useSqlBak. And the second you can use standard T-SQL Commands to restore your SQL Server.

SQL Server Restore Database from Backup

The first and the easiest way to performSQL Server restore database from backup is to use SqlBak. This is thevery simple tool which can create backups according to your schedule and send them to selected destination place on a regular basis. Also, you can simply restore your database from the backup.

SQL Server Restore Database from Backup Using SqlBak

Follow this simple tutorial and learn the way how to performSQL Server restore database from backup with the help ofSqlBak.

Go to your SqlBak Dashboard. Here you can promptly restore the last database backup or select the needed one. If you prefer to restore the last backup press “Restore” button.
SQL Server Restore Database from Backup
If it is necessary to select another database backup press at the backup job and select the backup you are going to restore.
SQL Server Restore Database from Backup
In the “Restore” window you will find SQL Server database backup which you are going to restore. Here you can select where you want to restore your backup on your computer or you can select another computer.
SQL Server Restore Database from Backup
To make SQL Server restore database from backup on your computer simply press “Restore”. If you prefer to restore the backup on different server click “on another computer” link, make all necessary settings and press “Restore”.
SQL Server Restore Database from Backup
You will receive the following message after the restore process will complete.
SQL Server Restore Database from Backup
SQL Server Restore Database from Backup UsingT-SQL Commands

In this a portion of our review, we are going to show how to make SQL Server restore database from backup with the help of T-SQL Commands.

SQL Server Restore Database from a Full Backup

Apply the following T-SQL Command to restore thefull 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 yourfull database backup you can restore a differential ortransaction logbackups. 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 ortransaction logbackups.

RESTORE DATABASE Adventureworks FROM DISK = 'D:Adventureworks_full.bak' SQL Server Restore Database from a Differential Backup

The T-SQL Command to restore thedifferential 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 SQL Server Restore Database from a 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 adifferential backup, if it needed, earlier.

RESTORE LOG Adventureworks FROM DISK = 'D:Adventureworks_log.trn' SQL Server 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:

Full backup Differential backup Transaction log backup 1 Transaction Log backup 2 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

本文数据库(mssql)相关术语:熊片数据库 mssql数据库 oracle数据库 pubmed数据库 access数据库 万方数据库

主题: SQLRESTSQL ServerRY
分页:12
转载请注明
本文标题:SQL Server Restore Database from Backup
本站链接:http://www.codesec.net/view/480451.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mssql) | 评论(0) | 阅读(47)