In this blog, we are going to cover Restore a backup using SQL Server. Restoring is the process of copying data from a backup and applying logged transactions to the data. Restore is what you do with backups. Take the backup file and turn it back into a database.
Topics we’ll cover in this blog:
- What is Azure Backup
- Connect To The VM And Download The Backup File
- Restore The Database And Verify Its Availability
What is Azure Backup
Azure Backup is a service offered within the platform that allows you to backup and restore your IaaS data both from within Azure and on-premises. The integration out-of-the-box within Azure and the attractive cost point make it a great option for many deployments.
Another advantage is the speed and productivity with which you can test and affirm your required restore processes. This has been as of late enhanced again by the introduction of Instant Restore. This introduces the ability to snapshots taken feature of a backup job, which are then accessible for recuperation without sitting tight for any data move to the vault. This reduces the wait time to trigger a restore.
Data restore is the process of copying backup data from secondary storage and restoring it to its original location or a new location. A restore is performed to return data that has been lost, stolen, or damaged to its original condition or to move data to a new location.
Connect To The VM And Download The Backup File
1.) On the Overview page for the virtual machine, select the Connect button and choose RDP.
2.) On the RDP tab, select the Download RDP File button.
3.) Open the RDP file that was just downloaded. When a dialog appears asking if you want to connect, select the Connect button.
4.) Enter the username and password selected during the virtual machine provisioning process. Then select the OK button.
5.) When the Remote Desktop Connection dialog appears asking if you want to connect, select the Yes button.
6.) A Remote Desktop window will open. On the right, select the No button to indicate you do not want the computer to be discoverable by other devices on the network. Close the small Server Manager popup dialog by clicking the X in the top right of the box. Keep the big Server Manager Window open.
7.) In the Server Manager window, select the local server on the left and then select On next to IE Enhanced Security Configuration.
8.) When the Internet Explorer Enhanced Security Configuration dialog appears, set administrators to Off. Then select the OK button.
9.) Open Internet Explorer by selecting the icon from the taskbar.
10.) In Internet Explorer, navigate to the following URL:
https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorksDW2017.bak
A dialog will appear asking if you would like to run or save the file.
11.) In the dialog, select the dropdown next to Save and choose Save As.
12.) In the Save As dialog, navigate to the following folder location:
C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup.
Leave the file name as AdventureWorksDW2017 and the type as BAK file. Select the Save button.
Restore The Database And Verify Its Availability
1.) Select the windows start button and type SSMS. Select Microsoft SQL Server Management Studio 18 from the list.
2.) When Management Studio opens, the Connect to Server dialog will be pre-populated to the local machine. Select the Connect button.
3.) In the Object Explorer, right-click on the Databases node and choose Restore Database.
4.) In the Restore Database dialog, select Device under Source, and select the button to the right of the device labeled with an ellipsis.
5.) In the Select backup devices dialog, select Add.
6.) In the Local Backup File dialog, select AdventureWorksDW2017.bak and select the OK button.
7.) Verify that there is now one item listed under backup media in the Select backup devices dialog. Then select the OK button.
8.) Verify that there is one item listed under backup sets to restore in the Restore Database dialog. Then select the OK button.
9.) Once the database restore completes, a dialog box will appear with the message “Database ‘AdventureWorksDW2017’ restored successfully”. Select the OK button.
10.) In the Object Explorer, expand the Databases node, then expand the AdventureWorksDW2017 node, then expand the Tables node. Verify that the database contains several tables including dbo.DimAccount.
11.) In Management Studio, select the AdventureWorksDW2017 node in the Object Explorer. Then select the New Query button.
12.) Copy and paste the following statement into the new query window.
SELECT CalendarYear, Sum(SalesAmount) SalesAmount FROM dbo.FactInternetSales FS INNER JOIN dbo.DimDate DD ON FS.OrderDateKey = DD.DateKey GROUP BY CalendarYear
13.) Select the Execute button that executes the query. Verify that the sales amount for 2010 is 43421.0364.
Related/References
- Exam DP-300: Microsoft Azure Database Administrator Associate
- Microsoft Certified Azure Database Administrator Associate(Hands-On Labs)
- Azure SQL Deployment Options | SQL Managed Instance | SQL Database| SQL On VM
- Migrate SQL Server To Azure SQL Database
- Implement A High Availability And Disaster Recovery Environment
- Use External Table On Azure SQL Managed Instance To Read Data From Azure SQL Database
- Optimize Query Performance In SQL Server
- Create alerts for Azure SQL Managed Instance
Next Task For You
We will cover all the exam objectives related to how to perform migrations, Hands-On Labs, and practice tests in our Azure Database Administrator training program. If you want to begin your journey towards becoming a Microsoft Certified: Azure Database Administrator Associate by checking our FREE CLASS.
The post Restore A Backup Using SQL Server appeared first on Cloud Training Program.