06 LabExercise
06 LabExercise
ALBA, JULIUS
ALBAO, MARIEL
AMPARADO, JEROME
BESIN, RUZZEL
BREIS, ANGELA JULIA
Laboratory Exercise
Backup and Recovery
1. Open/launch the Microsoft SQL Server Management Studio from your Windows computer and
use the default login using Windows Authentication.
2. Create a database named Sales. Execute the following commands in Data_Insert by dragging
and dropping down the file to Microsoft SQL Server Management Studio, then click Execute.
The commands that have been executed will automatically insert five thousand (5,000) rows
of data that will be used for this exercise. See the image below.
Sales query
3. Now that our Sales database contains 1 table with 5,000 rows of data. We will create a backup
file of the whole database through the Tasks function. Right-click the sales database, then click
Tasks, then click Backup.
4. For the source section, you can choose what database you would like to create a backup and
the type of backup. Select the Sales as the database that we will create a backup.
5. In the destination of the backup section, select the disk option in the “back up to:” drop-down
list.
6. Remove the existing destination path that has been automatically created by selecting the
existing path then click Remove.
7. We will choose a path destination where we could save our backup file. Click the Add button
below the drop-down list, then click the three (3) dot or Option button to show the lists of files
to choose from.
8. In my case, I want to save my database backup file in drive D:\Documents. Note: Don’t forget to
set the proper file name of the backup. Then click OK (Select Backup Destination window).
If the selected backup destination is properly set, click OK (Locate Database Files window).
See the image below for an example.
7.
7.
8.
8.
9. In the previous backup window, click OK to finalize the backup configuration and start backing
up. It should show a window indicating that the created backup was completed successfully.
10. To check the backup file, locate the file based on the destination entered on the previous
procedure.
1. For instance, our Sales database got destroyed or deleted by disaster or human error incidents.
To do this, delete the entire Sales_Record table by expanding our Sales database > Tables
folder > right- click the Sales_Record > Delete. Click OK when the prompt form shows.
2. Now, we need to restore the Sales database to get the database back in a consistent state.
Right-click the Sales database object, click Tasks > Restore > Database.
3. In the Restore Database - Sales window, select the device as the source, click the option or
three- dot button in the right corner, and then click Add to specify the backup file's file location.
4. Select the database backup file that we previously created using the Locate Backup File
window. Click All Files in the drop-down list to see your backup file. Select the database backup
file. Then click OK. See the following image for an example.
5. If the proper backup file is already selected, click OK to finalize the database to restore
configuration and start the process of restoring the database. It should show a window
indicating that the database Sales was restored successfully.s