Manage and Configure Databases
Manage and Configure Databases
Introduction
Designing Multiple Filegroups
Configuring and Standardizing Databases
Implementing and Configuring Contained Databases
Summary
Introduction
The Manage and Configure Databases 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:
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/31
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.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 2/31
7/23/2019 Print content
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 3/31
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 4/31
7/23/2019 Print content
In the right pane, click Add and enter SECONDARY in the text box that appears under
PRIMARY.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 5/31
7/23/2019 Print content
Click Add once again and enter PLAB in the new text box that appears under
SECONDARY and click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 6/31
7/23/2019 Print content
In the right pane, click Add and type AdventureWorks2012 in the Logical Name
column. Then, against AdventureWorks2012, in the Filegroup column, select
SECONDARY.
Managing File Space You can also move indexes from one filegroup to another
filegroup to manage file space. To move an index, perform the following steps:
Step 1
From Microsoft SQL Server Management Studio.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 7/31
7/23/2019 Print content
From the Filegroup drop-down list, select SECONDARY and click OK.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 8/31
7/23/2019 Print content
The Microsoft SQL Server Management Studio dialog box is displayed. Click OK.
Leave the devices you have powered on in their current state and proceed to the next
exercise.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 9/31
7/23/2019 Print content
Step 1
On PLABSQL01 In Object Explorer, expand Databases, expand System
Databases, right-click model, and then select Properties.
In the Automatic section, set Auto Shrink to True and click OK to close the window.
Note: Similarly, you can set multiple options in the database properties. For this task,
you will enable only the Auto Shrink option.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 10/31
7/23/2019 Print content
You are now navigated back to the Microsoft SQL Server Management Studio
(Administrator) window.
Configuring Partitioning
Step 1
Using Object Explorer, expand Databases, expand AdventureWorks2012, expand
Tables, right-click Person.Address, select Storage, and then select Create
Partition.
Click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 11/31
7/23/2019 Print content
On the Select a Partition Function screen, the New partition function is selected
by default. Enter PLAB in the text box and click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 12/31
7/23/2019 Print content
On the Select a Partition Scheme screen, the New partition scheme option is
selected by default. Enter PLAB_Schema in the text box and click Next.
From the Filegroup drop-down list, select PRIMARY and click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 13/31
7/23/2019 Print content
On the Select an Output Option screen, select Run immediately and click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 14/31
7/23/2019 Print content
You are now navigated back to the Microsoft SQL Server Management Studio
(Administrator) window.
Leave the devices you have powered on in their current state and proceed to the next
exercise.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 15/31
7/23/2019 Print content
Step 1
On PLABSQL01 In Object Explorer, right-click PLABSQL01, which is the server
name and select Properties.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 16/31
7/23/2019 Print content
Note that Containment section has the Enable Contained Databases option set to
False.
Click the Enable Contained Databases drop-down list, select True, and click OK.
You can also set containment at the individual database level. To do this, perform the
following steps:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 17/31
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 18/31
7/23/2019 Print content
Step 1
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 19/31
7/23/2019 Print content
Click Next.
Select Use same compression type for all partitions. Note that the drop-down list
next to Use same compression type for all partitions becomes active.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 20/31
7/23/2019 Print content
On the Select an Output Option screen, select Run immediately and click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 21/31
7/23/2019 Print content
The Compression Wizard Progress screen displays the progress status. Click Close.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 22/31
7/23/2019 Print content
You are now navigated back to the Microsoft SQL Server Management Studio
(Administrator) window.
Configuring TDE
Step 1
In Object Explorer, right-click PLABSQL01, which is the server name, and select
New Query.
USE master;
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Passw0rd';
GO
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 23/31
7/23/2019 Print content
After you have created the master encryption key, you will need to create a certificate that
is protected by the master key. This certificate will be used to encrypt databases.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 24/31
7/23/2019 Print content
After you have created the master encryption key and certificate, you need to create a
Database Encryption Key (DEK).
USE AdventureWorks2012;
GO
CREATE DATABASE ENCRYPTION KEY
WITH ALGORITHM = AES_128
ENCRYPTION BY SERVER CERTIFICATE ServerCertificate;
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 25/31
7/23/2019 Print content
After you have performed these first three steps, you need to encrypt the database. You
can do this by using the ALTER DATABASE statement.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 26/31
7/23/2019 Print content
After encrypting the database, you need to ensure that you have backed up the server
certificate. If you lose this certificate, you will not be able to access the data from the
database that you have encrypted.
Though this is an optional step, it is strongly recommended that you back up the server
certificate.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 27/31
7/23/2019 Print content
Step 1
In Object Explorer, expand Databases, right-click AdventureWorks2012, and
then select New Query.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 28/31
7/23/2019 Print content
Click the Messages tab in the bottom section of the right pane. Note the message
displayed.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 29/31
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 module, you covered carried the following practical tasks:
Also try
Using the current lab setup you can try the following concepts at your own pace.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 30/31
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 31/31