Professional Documents
Culture Documents
Introduction
Managing Backups
Restoring Databases
Summary
Introduction
The Configure and Maintain a Backup Strategy module provides you with the
instruction and server hardware to develop your hands on skills in the defined topics.
This module includes the following exercises:
Managing Backups
Restoring Databases
Lab Diagram
During your session you will have access to the following lab configuration. Depending
on the exercises you may or may not use all of the devices, but they are shown here in the
layout to get an overall understanding of the topology of the lab.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 1/34
7/23/2019 Print content
In this module you will be working on the following equipment to carry out the steps
defined in each exercise.
To start, simply choose a device and click Power on. In some cases, the devices may
power on automatically.
For further information and technical support, please see our Help and Support
page.
Copyright Notice
This document and its content is copyright of Practice-IT - © Practice-IT 2014. All rights reserved. Any
redistribution or reproduction of part or all of the contents in any form is prohibited other than the
following:
1) You may print or download to a local hard disk extracts for your personal and non-commercial use
only.
2) You may copy the content to individual third parties for their personal use, but only if you
acknowledge the website as the source of the material. You may not, except with our express written
permission, distribute or commercially exploit the content. Nor may you transmit it or store it in any
other website or other form of electronic retrieval system.
In this exercise, you will learn the following about Microsoft SQL Server 2012:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 2/34
7/23/2019 Print content
When backing up SQL databases, you can use different types of backup methods. The
type of backup mechanism you choose depends on your need, the frequency of the
backup, and the criticality of data. Here are some of the backup methods that you can
use:
Simple: In this method, most of the recent database can be recovered. However, no
point-in-time recovery can be performed.
Full: This method requires full database and transaction log backups. Using the
transaction logs, you can perform point-in-time recovery. You can also recover only
to the time when the full backup was performed.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 3/34
7/23/2019 Print content
Bulk-logged: This method minimizes the transaction log activity during the bulk
operations and, therefore, does not support point-in-time recovery.
You can use passwords to protect the media on which customer data is stored. The
password can be used to protect the data:
Even though the passwords do not provide a strong protection mechanism, they can
certainly deter unauthorized users from accessing the data.
In an SQL Server environment, the term "backing up" means backing up the databases
and transaction logs that exist on the SQL server.
Step 1
Ensure you have powered on the required devices and Connect to PLABSQL01.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 4/34
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 5/34
7/23/2019 Print content
After the backup is complete, the Microsoft SQL Server Management Studio dialog
box is displayed. Click OK to close the dialog box.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 6/34
7/23/2019 Print content
Step 1
From SQL Server Management Studio.
Note: In the previous task, you performed a full backup. In this task, you should perform
a differential backup and then perform a restore.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 7/34
7/23/2019 Print content
Keep the remaining settings as the default settings and click OK.
The Microsoft SQL Server Management Studio dialog box is displayed. Click OK
to close the dialog box.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 8/34
7/23/2019 Print content
After backing up the database, now you will restore the database. To restore the database,
right-click AdventureWorks2012, select Tasks, select Restore and then select
Database.
In the left pane, select Options and select Overwrite the existing database.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 9/34
7/23/2019 Print content
It may take a few minutes to a few hours to restore a database - depending on what the
size of the database is. After the restore is successful, the Microsoft SQL Server
Management Studio dialog box is displayed. Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 10/34
7/23/2019 Print content
You can create redundant backup media sets using the command line. Here is a sample
script that can help you create redundant media sets:
WITH
FORMAT,
MEDIANAME = 'AdventureWorks2012Backup';
GO
In this script, you can define the first set of backup media in the TO TAPE syntax. The
redundant media set needs to be defined in the MIRROR TO TAPE syntax.
You typically do not back up system databases at regular intervals. This is because you do
not alter the system databases. The transaction logs are also not backed up and,
therefore, you can use the Simple recovery method.
Step 1
From SQL Server Management Studio.
Note that the Recovery model field is automatically set to SIMPLE. For the purpose of
this lab, review and keep the default settings.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 12/34
7/23/2019 Print content
In the left pane, click Options. You can select various overwrite media options on the
Options tab. You can also configure reliability. For the purpose of this lab, review the
settings, keep the default settings, and click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 13/34
7/23/2019 Print content
The Microsoft SQL Server Management Studio dialog box is displayed. Click OK
to close the dialog box.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 14/34
7/23/2019 Print content
Leave the devices you have powered on in their current state and proceed to the next
exercise.
In this exercise, you will learn the following about Microsoft SQL Server 2012:
You can have databases that are encrypted using Transparent Data Encryption (TDE).
You can restore a TDE-encrypted database only if you have the certificate and the private
keys. Therefore, if you are backing up a TDE-encrypted database, you also back up the
certificate and the Database Encryption Key (DEK).
If you do not have the certificate available when you want to restore the encrypted
database, you will first have to re-create the database using the backup of the original
certificate. After you re-create the certificate, you will be able to restore the database.
Note that you can still use the certificate that has expired for encrypting and decrypting
the database with TDE.
Note: Before performing this task, ensure that you have backed up the model database
with FULL recovery.
Step 1
Ensure you have powered on the required devices and Connect to PLABSQL01.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 16/34
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 17/34
7/23/2019 Print content
Click Check Database Pages. Note that the Done message appears in the Progress
section of the left pane. However, there are no pages listed in the Pages section. This
means that there are no corrupt pages.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 18/34
7/23/2019 Print content
Restoring to Point-in-time
Point-in-time recovery can be performed only with the database that uses the Full
recovery model. Point-in-time recovery means that you can recover data from the most
recent committed transaction with the condition that you have the updated transaction
log available.
Step 1
From SQL Server Management Studio.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 19/34
7/23/2019 Print content
This will perform a point-in-time restore. However, if you choose not to perform point-
in-time restore, then you should click Timeline in the Destination section and select
the time from which you want to restore the database.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 20/34
7/23/2019 Print content
However, this task focuses on point-in-time and, therefore, you need to close the
Backup Timeline: AdventureWorks2012 dialog box and go back to the Restore
Database - AdventureWorks2012 dialog box.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 21/34
7/23/2019 Print content
In the Restore Options section, select Overwrite the existing database (WITH
REPLACE).
Note: Since you are restoring on the same instance, you will need to overwrite the
existing database and ensure all server connections are closed.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 22/34
7/23/2019 Print content
The restoration process starts. After it completes, the Microsoft SQL Server
Management Studio dialog box is displayed. Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 23/34
7/23/2019 Print content
File and file group restore can be performed if a database uses the full or bulk-logged
recovery model. When either of the recovery models is used, you can perform a file
restore and need not restore the entire database to restore the file and file group.
Step 1
From SQL Server Management Studio.
Note: Before performing the restore, ensure you have performed a full backup.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 24/34
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 25/34
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 26/34
7/23/2019 Print content
In the Restore Options section, select Overwrite the existing database (WITH
REPLACE) and click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 27/34
7/23/2019 Print content
The Microsoft SQL Server Management Studio dialog box is displayed. Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 28/34
7/23/2019 Print content
Page-level restores are typically performed when you figure out there are a number of
damaged pages in a database. You need to replace the damaged pages and, therefore, you
will need to restore pages from a backed up database. It is important to note that if
damaged pages are recurring too often in your database, then it is advisable to check the
volume on which the database is stored. To be able to perform page-level restore, you
need to have a backup database with the full or bulklogged recovery model.
Note: Before performing this task, ensure that you have backed up the model database
with FULL recovery.
Step 1
From SQL Server Management Studio.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 29/34
7/23/2019 Print content
In the Pages section, click Add. Note that a blank row appears under the File ID and
Page ID columns.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 30/34
7/23/2019 Print content
Click in the blank column under File ID and enter 1. Click in the blank column under
Page ID and click 10. Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 31/34
7/23/2019 Print content
The Microsoft SQL Server Management Studio dialog box is displayed. Click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 32/34
7/23/2019 Print content
Shutdown all virtual machines used in this lab, by using the power functions located in
the Tools bar before proceeding to the next module. Alternatively you can log out of the
lab platform.
Summary
In this exercise, you learnt the following about Microsoft SQL Server 2012:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 33/34
7/23/2019 Print content
Also try
Using the current lab setup, you can perform the following tasks at your own pace.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 34/34