31019710775AD-ENU-LabM.pdf

Embed Size (px)

Citation preview

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    1/195

    O F F I C I A L M I C R O S O F T L E A R N I N G P R O D U C T

    10775ALab Instructions and Lab Answer Key:Administering Microsoft®SQL Server® 2012 Database

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    2/195

    Information in this document, including URL and other Internet Web site references, is subject to change

    without notice. Unless otherwise noted, the example companies, organizations, products, domain names,

    e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with

    any real company, organization, product, domain name, e-mail address, logo, person, place or event is

    intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the

    user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in

    or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,

    photocopying, recording, or otherwise), or for any purpose, without the express written permission of

    Microsoft Corporation.

    Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property

    rights covering subject matter in this document. Except as expressly provided in any written license

    agreement from Microsoft, the furnishing of this document does not give you any license to these

    patents, trademarks, copyrights, or other intellectual property.

    The names of manufacturers, products, or URLs are provided for informational purposes only and

    Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding

    these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a

    manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links

    may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not

    responsible for the contents of any linked site or any link contained in a linked site, or any changes or

    updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission

    received from any linked site. Microsoft is providing these links to you only as a convenience, and the

    inclusion of any link does not imply endorsement of Microsoft of the site or the products contained

    therein.

    © 2012 Microsoft Corporation. All rights reserved.

    Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty

     /Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other trademarks are

    property of their respective owners 

    Product Number: 10775A

    Part Number: X18-29125

    Released: 05/2012

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    3/195

    Lab Instructions : Introduction to SQL Server® 2012 and Its Toolset 1

    Module 1

    Lab Instructions: Introduction to SQL Server® 2012 and ItsToolset

    Contents:

    Exercise 1: Verify SQL Server Component Installation 2 

    Exercise 2: Alter Service Accounts for New Instance 3

    Exercise 3: Enable Named Pipes Protocol for Both Instances 4Exercise 4: Create an Alias for AdvDev 4

    Challenge Exercise 5: Ensure SQL Browser Is Disabled and Configure

    a Fixed TCP/IP Port (Only if time permits) 5

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    4/195

    2 Lab Instructions: Introduction to SQL Server® 2012 and Its Toolset

    Lab 1: Introduction to SQL Server and Its Toolset

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    •  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    Lab Scenario

    AdventureWorks is a global manufacturer, wholesaler and retailer of cycle products. The owners of thecompany have decided to start a new direct marketing arm of the company. It has been created as a new

    company named Proseware, Inc. Even though it has been set up as a separate company, it will receive

    some IT-related services from the existing AdventureWorks company and will be provided with a subset

    of the corporate AdventureWorks data. The existing AdventureWorks company SQL Server platform has

    been moved to a new server that is capable of supporting both the existing workload and the workload

    from the new company. In this lab, you are ensuring that the additional instance of SQL Server has been

    configured appropriately and making a number of additional required configuration changes.

    Exercise 1: Verify SQL Server Component Installation

    A new instance of SQL Server has been installed by the IT department at AdventureWorks. It will be used

    by the new direct marketing company. The SQL Server named instance is called MKTG. In the first

    exercise, you need to verify that the required SQL Server components have been installed.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    5/195

      Lab Instructions: Introduction to SQL Server® 2012 and Its Toolset 3

    The main tasks for this exercise are as follows:

    1. 

    Check that Database Engine and Reporting Services have been installed for the MKTG instance.

    2. 

    Note the services that are installed for the default instance.

    3.  Ensure that all required services including SQL Server Agent are started and set to autostart for both

    instances.

      Task 1: Check that Database Engine and Reporting Services have been installed for the

    MKTG instance 

    • 

    Open SQL Server Configuration Manager.

    •  Check the installed list of services for the MKTG instance and ensure that the database engine and

    Reporting Services have been installed for the MKTG instance.

      Task 2: Note the services that are installed for the default instance 

    •  Note the list of services that are installed for the default instance.

      Task 3: Ensure that all required services including SQL Server Agent are started and set

    to autostart for both instances 

    •  Ensure that all the MKTG services are started and set to autostart. (Ignore the Full Text Filter Daemon

    at this time).

    •  Ensure that all the services for the default instance are set to autostart. (Ignore the Full Text Filter

    Daemon at this time).

    Results: After this exercise, you have checked that the required SQL Server services are installed,started, and configured to autostart.

    Exercise 2: Alter Service Accounts for New Instance

    Scenario

    The SQL Server services for the MKTG instance have been configured to execute under the

    AdventureWorks\SQLService service account. In this exercise, you will configure the services to execute

    under the AdventureWorks\PWService service account.

    The main tasks for this exercise are as follows:

    1.  Change the service account for the MKTG database engine.

    2. 

    Change the service account for the MKTG SQL Server Agent.

      Task 1: Change the service account for the MKTG database engine 

    •  Change the service account for the MKTG database engine service to AdventureWorks\PWService

    using the properties page for the service.

      Task 2: Change the service account for the MKTG SQL Server Agent 

    •  Change the service account for the MKTG SQL Server Agent service to AdventureWorks\PWService

    using the properties page for the service and then restart the service.

    Results: After this exercise, you have configured the service accounts for the MKTG instance.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    6/195

    4 Lab Instructions: Introduction to SQL Server® 2012 and Its Toolset

    Exercise 3: Enable Named Pipes Protocol for Both Instances

    Scenario

    Client applications that are installed on the server will connect to the database engine using the named

    pipes protocol. In this exercise, you will ensure that the named pipes protocol is enabled for both

    database engine instances.

    The main tasks for this exercise are as follows:

    1. 

    Enable the named pipes protocol for the default instance.

    2. 

    Enable the named pipes protocol for the MKTG instance.

    3.  Restart database engine services for both instances.

      Task 1: Enable the named pipes protocol for the default instance 

    • 

    If necessary, enable the named pipes protocol for the default database engine instance using the

    Protocols window.

      Task 2: Enable the named pipes protocol for the MKTG instance 

    • 

    If necessary, enable the named pipes protocol for the MKTG database engine instance using the

    Protocols window.

      Task 3: Restart both database engine services 

    •  If necessary, restart the default database engine instance.

    •  If necessary, restart the MKTG database engine instance.

    •  Check to ensure that both instances have been restarted successfully.

    Results: After this exercise, you should have ensured that the named pipes protocol is enabled for bothdatabase engine instances.

    Exercise 4: Create an Alias for AdvDev

    Scenario

    One badly-written monitoring application has been installed on the server. Unfortunately, it requires a

    hard-coded server name of AdvDev. In this exercise, you will configure and test an alias for AdvDev that

    points to the MKTG server. Use the Named Pipes protocol. Both 32 bit and 64 bit aliases should be

    configured. You will use SQL Server Management Studio to test the alias once it has been configured.

    The main tasks for this exercise are as follows:

    1. 

    Create a 32-bit alias (AdvDev) for the MKTG instance.

    2.  Create a 64-bit alias (AdvDev) for the MKTG instance.

    3.  Use SQL Server Management Studio to connect to the alias to ensure it works as expected.

      Task 1: Create a 32-bit alias (AdvDev) for the MKTG instance 

    • 

    Create a 32-bit alias for the MKTG instance. Call the alias AdvDev and connect via named pipes. Use

    the servername ".\MKTG".

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    7/195

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    8/195

    Lab Instructions: Preparing Systems for SQL Server 2012 1

    Module 2

    Lab Instructions: Preparing Systems for SQL Server 2012

    Contents:

    Exercise 1: Adjust Memory Configuration 3 

    Exercise 2: Pre-installation Stress Testing 4 

    Challenge Exercise 3: Check Specific I/O Operations (Only if time permits) 5

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    9/195

    2 Lab Instructions: Preparing Systems for SQL Server 2012

    Lab 2: Preparing Systems for SQL Server

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1.  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2. 

    In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and click

    SQL Server Management Studio.

    3.  In Connect to Server window, type Proseware in the Server name text box.

    4. 

    In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5. 

    In the File menu, click Open, and click Project/Solution.

    6.  In the Open Project window, open the project

    D:\10775A_Labs\10775A_02_PRJ\10775A_02_PRJ.ssmssln.

    7.  From the View menu, click Solution Explorer. In Solution Explorer, double-click the query

    00-Setup.sql. When the query window opens, click Execute on the toolbar.

    Lab Scenario

    You have reviewed the additional instance of SQL Server. A system administrator at AdventureWorks hasexpressed some concerns that the existing server may not have enough memory or I/O capacity to

    support this new SQL Server instance and is reviewing a new I/O subsystem. As the database

    administrator, you need to review the available server memory and the memory allocated to each of the

    existing SQL Server instances. You need to ensure that the I/O subsystem of the new server is capable of

    running SQL Server and the required workload correctly.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    10/195

      Lab Instructions: Preparing Systems for SQL Server 2012 3

    Supporting Documentation

    Required Memory Configuration 

    •  1.5GB reserved for operating system.

    •  60% of the remaining memory as the maximum value for the AdventureWorks server instance.

    • 

    40% of the remaining memory as the maximum value for the Proseware server instance.

    • 

    Configure minimum memory as zero for both instances.

    Required SQLIOSIM Configuration 

    •  Drive D with a 100MB data file that grows by 20MB increments to a 200MB maximum size.

    • 

    Drive L with a 50MB log file that grows by 10MB increments to a 100MB maximum size.

    •  Cycle Duration (sec) set to 60 seconds.

    •  Delete Files at Shutdown should be selected.

    Required SQLIO Tests 

    • 

    Drive to be tested is D. 

    •  Test 64KB sequential reads for 60 seconds. 

    • 

    Test 8KB random writes for 60 seconds. 

    Exercise 1: Adjust Memory Configuration

    Scenario

    The Adventure Works Marketing server has an existing default Microsoft SQL Server 2012 instance

    installed and the new MKTG instance. You need to check the total memory available on the server and

    how much memory has been allocated to each of the two existing SQL Server instances. You should then

    decide if the memory allocation is appropriate. If not, make the required changes to the memory

    configuration.

    The main tasks for this exercise are as follows:

    1.  Check total server memory.

    2. 

    Check the memory allocated to the default instance.

    3. 

    Check the memory allocated to the MKTG instance.

    4.  Decide if the memory allocation is appropriate. If not, make the required changes to the memory

    configuration.

      Task 1: Check total server memory

    • 

    Retrieve the installed memory (RAM) value from the properties of the computer.

      Task 2: Check the memory allocated to the default instance

    • 

    Using the properties of the AdventureWorks server instance in SSMS, retrieve the minimum and

    maximum server memory settings.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    11/195

    4 Lab Instructions: Preparing Systems for SQL Server 2012

      Task 3: Check the memory allocated to the MKTG instance

    •  Using the properties of the Proseware server instance in SSMS, retrieve the minimum and maximum

    server memory settings.

      Task 4: Decide if the memory allocation is appropriate. If not, make the required

    changes to the memory configuration•  Review the Required Memory Configuration from the Supporting Documentation.

    •  Alter the Memory Configuration for both SQL Server instances as per the requirements. You will need

    to work out how much memory should be used for all SQL Server instances and apportion the

    memory based on the requirements in the Supporting Documentation.

    Note  While reducing the max server memory might require restarting SQL Server, there is

    no need to restart the servers at this point in the exercise.

    Results: After this exercise, you should have configured the memory for the SQL Server Instances.

    Exercise 2: Pre-installation Stress Testing

    Scenario

    After you have reviewed allocated memory on the server, you need to test whether the new I/O

    subsystem is capable of running SQL Server successfully. In this exercise, you need to use the SQLIOSIM

    utility for stress testing to ensure the stability of SQL Server performance.

    The main tasks for this exercise are as follows:

    1.  Configure SQLIOSIM.

    2. 

    Execute SQLIOSIM.

    3. 

    Review the results from executing SQLIOSIM.

      Task 1: Configure SQLIOSIM

    •  Install SQLIOSIM from the file D:\10775A_Labs\10775A_02_PRJ\sqliosimx64.exe (Make sure that you

    use the Run as administrator option).

    •  Configure SQLIOSIM as per requirements in the Supporting Documentation.

      Task 2: Execute SQLIOSIM

    • 

    Execute SQLIOSIM based upon the configured parameters.

      Task 3: Review the results from executing SQLIOSIM

    •  If any errors are returned in red, review the errors.

    • 

    Locate the final summary for each of the drives and note the average I/O duration in milliseconds.

    Results: After this exercise, you have run a stress test using SQLIOSIM.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    12/195

      Lab Instructions: Preparing Systems for SQL Server 2012 5

    Challenge Exercise 3: Check Specific I/O Operations (Only if time permits)

    Scenario

    You have identified a specific list of I/O workloads and plan to test their performance on the new I/O

    subsystem. In this exercise, you need to run the SQLIO utility to verify the I/O workloads.

    The main tasks for this exercise are as follows:

    1.  Install the SQLIO Utility.

    2.  Configure and Execute the SQLIO Utility.

      Task 1: Install the SQLIO Utility

    •  Install the SQLIO Utility from the file D:\10775A_Labs\10775A_02_PRJ\SQLIO.msi (Choose to install for

    all users).

      Task 2: Configure and Execute the SQLIO Utility

    •  Review the Supporting Documentation for details of the SQLIO tests to be performed.

    •  Configure the file C:\Program Files (x86)\SQLIO\param.txt as per the requirements in the Supporting

    Documentation.

    •  Execute the sqlio.exe program from within a command window, to test the I/O types as requested in

    the Supporting Documentation. For each test, record the IOPS and throughput achieved. Also note

    the minimum, maximum and average latency for each test.

    Results: After this exercise, you should have executed the SQLIO utility to test specific I/Ocharacteristics.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    13/195

    Lab Instructions: Installing and Configuring SQL Server 2012 1

    Module 3

    Lab Instructions: Installing and Configuring SQL Server 2012

    Contents:

    Exercise 1: Review Installation Requirements 4

    Exercise 2: Install the SQL Server Instance 4

    Exercise 3:  Perform Post-installation Setup and Checks 5 

    Challenge Exercise 4: Configure Server Memory (Only if time permits) 5

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    14/195

    2 Lab Instructions: Installing and Configuring SQL Server 2012

    Lab 3: Installing and Configuring SQL Server

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1.  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2.  In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and click

    SQL Server Management Studio.

    3.  In the Connect to Server window, type Proseware in the Server name text box.

    4.  In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5. 

    In the File menu, click Open, and click Project/Solution.

    6.  In the Open Project window, open the project

    D:\10775A_Labs\10775A_03_PRJ\10775A_03_PRJ.ssmssln.

    7.  From the View menu, click Solution Explorer. In Solution Explorer, double-click the query

    00-Setup.sql. When the query window opens, click Execute on the toolbar.

    8. 

    On the host system, in the Virtual Machines list in Hyper-V Manager, right-click the

    10775A-MIA-SQL1 virtual machine and click Settings.

    9. 

    In the Settings for 10775A-MIA-SQL1 window, in the Hardware list expand IDE Controller 1, and

    click DVD Drive.

    10.  In the DVD Drive properties pane, click Image file, and click browse.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    15/195

      Lab Instructions: Installing and Configuring SQL Server 2012 3

    11.  Navigate to the file C:\Program Files\Microsoft Learning\10775\Drives\10775A-MIA-SQL1

    \Virtual Hard Disks\SQLFULL_ENU.iso and click Open.

    12.  In the Settings for 10775A-MIA-SQL1 window, click OK .

    Lab Scenario

    The development group within the company has ordered a new server for the work they need to do onthe Proseware system. Unfortunately, the new server will not arrive for a few weeks and the development

    group cannot wait that long to start work.

    The new server that was provisioned by the IT Support department already has two instances of SQL

    Server installed. The support team has determined that the new server will be able to support an

    additional instance of SQL Server on a temporary basis, until the server for the development group arrives.

    You need to install the new instance of SQL Server and if you have time, you should configure the

    memory of all three instances to balance their memory demands, and you should create a new alias for

    the instance that you install.

    Supporting Documentation

    Required SQL Server Instance Configuration 

    Item Configuration

    Instance Name MKTGDEV

    Features Database Engine only (excluding Full Text and Replication)

    Data File Folder D:\MKTGDEV for user databases and tempdb

    Log File Folder L:\MKTGDEV for user databases and tempdb

    Service Accounts AdventureWorks\PWService for all services

    Startup Both SQL Server and SQL Server Agent should start

    automatically

    Server Collation SQL_Latin1_General_CP1_CI_AS

    Authentication Mode Mixed

    Administrative User AdventureWorks\Administrator

    Filestream Support Disabled

    Note that Pa$$w0rd is used for all passwords in the course.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    16/195

    4 Lab Instructions: Installing and Configuring SQL Server 2012

    Required Memory Configuration (Used in Exercise 4 only) 

    •  1.0GB reserved for operating system.

    •  40% of the remaining memory as the maximum value for the AdventureWorks server instance.

    •  30% of the remaining memory as the maximum value for the Proseware server instance.

    • 

    30% of the remaining memory as the maximum value for the PWDev server instance.

    •  Configure minimum memory as zero for all instances.

    Exercise 1: Review Installation Requirements

    Scenario

    You will review the supporting documentation that describes the required configuration for the new

    instance. You will also create the required folders to hold the data and log files for the instance.

    The main tasks for this exercise are as follows:

    1. 

    Review the supporting documentation prior to installation.

    2. 

    Create the folders that are required for the data and log files.

      Task 1: Review the supporting documentation prior to installation

    •  Review the supplied requirements in the supporting documentation for the exercise.

      Task 2: Create the folders that are required for the data and log files

    •  Based on the supplied requirements, create the folders that are required for the data and log files ofthe new SQL Server instance.

    Results: After this exercise, you should have read the requirements and created the twofolders that are required.

    Exercise 2: Install the SQL Server Instance

    Scenario

    In this exercise, you need to perform an installation of another instance of SQL Server on the existing

    server based on the supplied specifications. In the setup steps for this lab, you have mounted an ISO file

    that contains an image of SQL Server that will be used to install the instance. Pre-requisites have already

    been installed as there are existing instances of SQL Server.

    The main task for this exercise is as follows:

    1.  Based on the requirements reviewed in Exercise 1, install another instance of SQL Server.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    17/195

      Lab Instructions: Installing and Configuring SQL Server 2012 5

      Task 1: Based on the requirements reviewed in Exercise 1, install another instance of SQL

    Server

    •  Install another instance of SQL Server based on the requirements in Exercise 1.

    Note  On the Server Configuration page, you should configure the service account name

    and password, the startup type for SQL Server Agent, and the collation. On the DatabaseEngine Configuration page, you should configure Mixed Mode, the sa password, AddCurrent User, Data Directories tab, and the Filestream tab.

    Results: After this exercise, you should have installed another SQL Server instance.

    Exercise 3: Perform Post-installation Setup and Checks

    Scenario

    You need to make sure that the services for the new instance are running and you need to create a new

    alias for the instance you have just installed. Once the instance is created, you should connect to the

    instance using SQL Server Management Studio to make sure that the instance works.

    The main tasks for this exercise are as follows:

    1.  Check that the services for the new SQL Server instance are running.

    2.  Configure both 32 bit and 64 bit aliases for the new instance.

    3. 

    Connect to the new instance using SSMS.

      Task 1: Check that the services for the new SQL Server instance are running

    •  Using SQL Server Configuration Manager, make sure that the newly installed services are running.

    •  Make sure that the named pipes protocol is enabled for the new instance.

     

    Task 2: Configure both 32 bit and 64 bit aliases for the new instance

    •  Configure a 32 bit alias called PWDev for the new instance using named pipes.

    •  Configure a 64 bit alias called PWDev for the new instance using named pipes.

      Task 3: Connect to the new instance using SSMS

    •  Start SQL Server Management Studio and connect to the new instance to make sure it is working.Make the connection using the PWDev alias.

    Results: After this exercise, you should have checked that the services are running, created a new alias,and connected using SSMS.

    Challenge Exercise 4: Configure Server Memory (Only if time permits)

    Scenario

    There are now three SQL Server instances installed on the Marketing server at AdventureWorks. In thisexercise, you need to configure the amount of memory that is allocated to each instance.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    18/195

    6 Lab Instructions: Installing and Configuring SQL Server 2012

    The main tasks for this exercise are as follows:

    1.  Review the current memory available on the server.

    2. 

    Determine an appropriate memory allocation for each instance.

    3.  Configure each instance appropriately.

     

    Task 1: Review the current memory available on the server

    •  Review the current memory available on the server.

      Task 2: Determine an appropriate memory allocation for each instance

    •  Review the required memory proportions as specified in the supporting documentation.

    •  Determine an appropriate memory allocation for each instance.

      Task 3: Configure each instance appropriately

    •  Configure each instance based on the values you have calculated.

    Results: After this exercise, you should have modified the memory allocation for each SQL Server

    instance.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    19/195

    Lab Instructions: Working with Databases 1

    Module 4

    Lab Instructions: Working with Databases

    Contents:

    Exercise 1: Adjust tempdb Configuration 5 

    Exercise 2: Create the RateTracking Database 5 

    Exercise 3: Attach the OldProspects Database 6 

    Challenge Exercise 4: Add Multiple Files to tempdb (Only if time permits) 6

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    20/195

    2 Lab Instructions: Working with Databases

    Lab 4: Working with Databases

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1.  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2. 

    In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and click

    SQL Server Management Studio.

    3.  In the Connect to Server window, type Proseware in the Server name text box.

    4. 

    In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5. 

    In the File menu, click Open, and click Project/Solution.

    6.  In the Open Project window, open the project

    D:\10775A_Labs\10775A_04_PRJ\10775A_04_PRJ.ssmssln .

    7.  From the View menu, click Solution Explorer. In Solution Explorer, double-click the query

    00-Setup.sql. When the query window opens, click Execute on the toolbar.

    Lab Scenario

    Now that the Proseware instance of SQL Server has been installed and configured on the server, a numberof additional database configurations need to be performed. As the database administrator, you need to

    perform these configuration changes.

    You need to create a new database on the server, based on requirements from an application vendor’s

    specifications. A client has sent you a database that needs to be installed on the Proseware instance.

    Instead of sending you a backup, they have sent a detached database and log file. You need to attach the

    database to the Proseware instance.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    21/195

      Lab Instructions: Working with Databases 3

    A consultant has also provided recommendations regarding tempdb configuration that you need to

    review and implement if appropriate.

    Supporting Documentation

    tempdb Size Requirement (For Exercise 1)File Size (in MB)

    Data 30

    Log 10

    RateTracking Database Specification

    Item Requirement

    DatabaseName RateTracking

    Primary Data File Logical name = RateTracking_datFile name = RateTracking.mdfFolder = D:\MKTGInitial size = 10MBMaximum file size = 100MBAutogrowth amount = 10MBFilegroup = PRIMARY

    Log File Logical name = RateTracking_logFile name = RateTracking.ldfFolder = L:\MKTGInitial size = 20MBMaximum file size = unlimitedAutogrowth amount = 20MB

    Filegroup = Not ApplicableSecondary Data File #1 Logical name = RateTracking_dat_1

    File name = RateTracking_1.ndfFolder = D:\MKTGInitial size = 20MBMaximum file size = 100MBAutogrowth amount = 10MBFilegroup = USERDATA

    Secondary Data File #2 Logical name = RateTracking_dat_2File name = RateTracking_2.ndfFolder = D:\MKTGInitial size = 20MBMaximum file size = 100MB

    Autogrowth amount = 10MBFilegroup = USERDATA

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    22/195

    4 Lab Instructions: Working with Databases

    (continued)

    Item Requirement

    Secondary Data File #3 Logical name = RateTracking_dat_3File name = RateTracking_3.ndfFolder = D:\MKTG

    Initial size = 200MBMaximum file size = 500MBAutogrowth amount = 50MBFilegroup = ARCHIVE

    Secondary Data File #4 Logical name = RateTracking_dat_4File name = RateTracking_4.ndfFolder = D:\MKTGInitial size = 200MBMaximum file size = 500MBAutogrowth amount = 50MBFilegroup = ARCHIVE

    Default Filegroup USERDATA

    tempdb Requirements From The Consultant (For Exercise 4)

    1. 

    Move the tempdb primary data file to the folder D:\MKTG.

    2.  Move the tempdb log file to the folder L:\MKTG.

    3. 

    Add three additional files to tempdb as per the following table:

    Filename Requirements

    Secondary Data File #1 Logical name = tempdev2File name = tempdb_file2.ndfFolder = D:\MKTGInitial size = 20MBMaximum file size = unlimited

    Autogrowth amount = 10MB

    Secondary Data File #2 Logical name = tempdev3File name = tempdb_file3.ndfFolder = D:\MKTGInitial size = 20MBMaximum file size = unlimitedAutogrowth amount = 10MB

    Secondary Data File #3 Logical name = tempdev4File name = tempdb_file4.ndfFolder = D:\MKTGInitial size = 20MBMaximum file size = unlimitedAutogrowth amount = 10MB

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    23/195

      Lab Instructions: Working with Databases 5

    Exercise 1: Adjust tempdb Configuration

    Scenario

    You will adjust the current configuration of the tempdb database.

    The main tasks for this exercise are as follows:

    1. 

    Adjust the size of tempdb.

    2. 

    Check that the tempdb size is still correct after a restart.

      Task 1: Adjust the size of tempdb

    •  Review the requirement for tempdb size in the Supporting Documentation.

    • 

    Adjust the tempdb size based on the requirement in the supporting documentation.

      Task 2: Check that the tempdb size is still correct after a restart

    •  Restart the Proseware server using SQL Server Configuration Manager.

    • 

    Check that tempdb is still the correct size.

    Results: After this exercise, you should have inspected and configured the tempdb database.

    Exercise 2: Create the RateTracking Database

    Scenario

    You will create a new database named RateTracking as per a supplied set of specifications.

    The main tasks for this exercise are as follows:

    1. 

    Create the database.

    2. 

    Create the required filegroups and files.

    3. 

    Change the default filegroup for the database.

      Task 1: Create the database

    • 

    Review the supplied requirements in the supporting documentation for the exercise.

    •  Create a new RateTracking database based on the requirements.

      Task 2: Create the required filegroups and files

    • 

    Review the supplied requirements in the supporting documentation for the required files and

    filegroups.

    • 

    Create the required filegroups and files.

     Task 3: Change the default filegroup for the database•  Review the supplied requirements in the supporting documentation for the default filegroup.

    • 

    Modify the default filegroup.

    Results: After this exercise, you should have created a new RateTracking database with multiplefilegroups.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    24/195

    6 Lab Instructions: Working with Databases

    Exercise 3: Attach the OldProspects Database

    Scenario

    A client has sent you a database that needs to be installed on the Proseware instance. Instead of sending

    you a backup, they have sent a detached database and log file. You need to attach the database to the

    Proseware instance.

    The main tasks for this exercise are as follows:

    1. 

    Copy the database files.

    2.  Attach the database to the MKTG instance.

      Task 1: Copy the database files

    • 

    Copy the files to new folders as per the table below:

    Filename Source Folder Destination Folder

    OldProspects.mdf D:\10775A_Labs\10775A_04_PRJ D:\MKTG

    OldProspects.ldf D:\10775A_Labs\10775A_04_PRJ L:\MKTG

      Task 2: Attach the database to the MKTG instance

    •  Attach the OldProspects database to the MKTG instance.

    Results: After this exercise, you should have attached a database to a client’s server.

    Challenge Exercise 4: Add Multiple Files to tempdb (Only if time permits)

    Scenario

    A consultant has also provided recommendations regarding tempdb configuration that you need to

    review and implement.

    The main tasks for this exercise are as follows:

    1. 

    Review the tempdb file requirements.

    2. 

    Move existing files.

    3.  Add new files.

    4. 

    Restart the server and check file locations.

      Task 1: Review the tempdb file requirements

    •  In the Supporting Documentation review the tempdb Requirements From The Consultant section.

     

    Task 2: Move existing files• 

    Move the existing tempdb data and log files to the required locations as specified in the supporting

    documentation.

      Task 3: Add new files

    • 

    Add the additional tempdb files as required in the supporting documentation.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    25/195

      Lab Instructions: Working with Databases 7

      Task 4: Restart the server and check file locations

    • 

    Restart the Proseware server.

    •  View the Properties of the tempdb database and ensure the list of files match the requirements.

    Results: After this exercise, you should have reconfigured tempdb as per the requirements.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    26/195

    Lab Instructions: Understanding SQL Server 2012 Recovery Models 1

    Module 5

    Lab Instructions: Understanding SQL Server 2012 RecoveryModels

    Contents:

    Exercise 1: Plan a Backup Strategy 5 

    Exercise 2: Configure Recovery Models 6

    Challenge Exercise 3: Review Recovery Models and Strategy(Only if time permits) 7 

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    27/195

    2 Lab Instructions: Understanding SQL Server 2012 Recovery Models

    Lab 5: Understanding SQL Server Recovery Models

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1.  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2. 

    In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and click

    SQL Server Management Studio.

    3.  In the Connect to Server window, type Proseware in the Server name text box.

    4. 

    In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5. 

    In the File menu, click Open, and click Project/Solution.

    6.  In the Open Project window, open the project

    D:\10775A_Labs\10775A_05_PRJ\10775A_05_PRJ.ssmssln.

    7.  From the View menu, click Solution Explorer. In Solution Explorer, double-click the query

    00-Setup.sql. When the query window opens, click Execute on the toolbar.

    Lab Scenario

    You need to implement a database recovery strategy. The business unit from Proseworks, Inc. hasprovided you with the availability needs for the databases on the new Proseware SQL Server instance. You

    need to plan how you will meet the requirements and then implement your strategy.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    28/195

      Lab Instructions: Understanding SQL Server 2012 Recovery Models 3

    If you have time, there is another issue that your manager would like you to work on. There is another

    instance of SQL Server installed for supporting Customer Service operations. There is concern that existing

    databases on the CustomerService server instance are configured inappropriately and have invalid backup

    strategies, based on their RPO and RTO requirements. In this exercise, you need to review the database

    recovery models and backup strategies for the databases on the CustomerService instance and provide

    recommended changes.

    Supporting Documentation

    Business Database Continuity Requirements for Databases on the Proseware ServerInstance (for Exercises 1 and 2)

    Recovery Time Objectives

    1.  The MarketDev database must never be unavailable for longer than eight hours.

    2. 

    The Research database must never be unavailable for longer than two hours.

    Recovery Point Objectives

    1. 

    When the MarketDev database is recovered from a failure, no more than 30 minutes of transactions

    may be lost.

    2. 

    When the Research database is recovered from a failure, all transactions that were completed up to

    the end of the previous weekday must be recovered.

    Projected Characteristics

    Characteristic Estimated Value

    MarketDev database size 20GB

    Research database size 200MB

    Total backup throughput 100MB per minute

    Total restore throughput 80MB per minute

    Average rate of change to the MarketDev database during office

    hours

    1GB per hour

    Average rate of change to the Research database during office hours 10MB per hour

    Percentage of the MarketDev database changed each day (average) 1.2%

    Percentage of the Research database changed each day (average) 80%

    Office hours (no full database backups permitted during these hours) 8am to 6pm

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    29/195

    4 Lab Instructions: Understanding SQL Server 2012 Recovery Models

    Business Database Continuity Requirements for Databases on the CustomerServiceServer Instance (for Exercises 3)

    Recovery Time Objectives

    1. 

    The CreditControl database must never be unavailable for longer than two hours.

    2. 

    The PotentialIssue database must never be unavailable for longer than one hour.

    Recovery Point Objectives

    1. 

    When the CreditControl database is recovered from a failure, no more than five minutes of

    transactions may be lost.

    2. 

    When the PotentialIssue database is recovered from a failure, no more than 30 minutes of

    transactions may be lost.

    Projected Characteristics

    Characteristic Estimated Value

    CreditControl database size 20GB

    PotentialIssue database size (at the start of each week after

    archiving activity is complete)

    200MB

    Total backup throughput 100MB per minute

    Total restore throughput 80MB per minute

    Average rate of change to the CreditControl database during office

    hours

    500MB per hour

    Average rate of change to the PotentialIssue database (constant all

    week long 24 hours per day)

    10MB per hour

    Percentage of the CreditControl database changed each day

    (average)

    60%

    Percentage of the PotentialIssue database changed each day

    (average)

    50%

    Office hours (no full database activity permitted during these

    hours)

    8am to 7pm

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    30/195

      Lab Instructions: Understanding SQL Server 2012 Recovery Models 5

    Existing Backup Strategy For CreditControl Database 

    Recovery Model: Full 

    Type of Backup Schedule

    •  Full •  Saturday at 6AM,

    Wednesday at 6AM

    •  Differential •  Sunday at 10PM,

    Monday at 10PM,

    Tuesday at 10PM,

    Thursday at 10PM,

    Friday at 10PM

    •  Log •  Every 60 minutes on the hour

    Existing Backup Strategy For PotentialIssue Database 

    Recovery Model: Full 

    Type of Backup Schedule

    •  Full •  Sunday at 10PM

    • 

    Log • 

    Every 15 minutes starting at 10 minutes pas

    the hour

    Exercise 1: Plan a Backup Strategy

    Scenario

    You need to plan a backup strategy for the two databases on the new Proseware instance. You have been

    provided with RPO (recovery point objectives) and RTO (recovery time objectives) for both databases, as

    part of a business continuity statement.

    The main tasks for this exercise are as follows:

    1. 

    Review the business requirements.

    2.  Determine an appropriate backup strategy for each database.

      Task 1: Review the business requirements

    •  Review the supplied business requirements in the supporting documentation for the exercise.

     Task 2: Determine an appropriate backup strategy for each database•  Determine an appropriate backup strategy for each database.

    •  For the MarketDev database:

    •  Which recovery model should be used?

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    31/195

    6 Lab Instructions: Understanding SQL Server 2012 Recovery Models

    •  Complete the following table for the backup schedule:

    Type of Backup Schedule

    •  • 

    •  • 

    •  • 

    •  For the Research database:

    • 

    Which recovery model should be used?

    •  Complete the following table for the backup schedule:

    Type of Backup Schedule

    •  • 

    •  • 

    •  • 

    Results: After this exercise, you should have created a plan to backup two databases.

    Exercise 2: Configure Recovery Models

    Scenario

    You have reviewed the database recovery models and identified that the current database recovery

    models do not meet the availability needs of the business. In this exercise, you need to set the recovery

    models for the databases that do not meet the requirements.

    The main task for this exercise is as follows:

    1. 

    Review and adjust the current database recovery models. 

      Task 1: Review and adjust the current database recovery models

    • 

    Review the recovery models that you decided were required in Exercise 1, check whether or not the

    existing recovery models for the MarketDev and Research databases match your recommendations. If

    not, change the recovery models as per your recommendations.

    Results: After this exercise, you should have reviewed and modified the databaserecovery models where required.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    32/195

      Lab Instructions: Understanding SQL Server 2012 Recovery Models 7

    Challenge Exercise 3: Review Recovery Models and Strategy (Only if timepermits)

    Scenario

    There is another instance of SQL Server installed for supporting Customer Service operations. There is

    concern that existing databases on the CustomerService server instance are configured inappropriately

    and have invalid backup strategies, based on their RPO and RTO requirements. In this exercise, you need

    to review the database recovery models and backup strategies for the databases on the CustomerService

    instance and provide recommended changes.

    The main tasks for this exercise are as follows:

    1. 

    Review the RPO and RTO requirements for the databases. 

    2. 

    Review the existing recovery models and backup strategies.

    3.  Indicate whether or not the strategy would be successful.

      Task 1: Review the RPO and RTO requirements for the databases

    • 

    The supporting documentation includes details of the business continuity requirements for the

    databases. You need to review this documentation.

      Task 2: Review the existing recovery models and backup strategies

    • 

    The supporting documentation also includes details of the backup strategy for the databases. You

    need to review this documentation.

      Task3: Indicate whether or not the strategy would be successful

    •  You need to assess whether or not the current backup strategy and recovery model configuration is

    capable of supporting the business continuity requirements. If not, explain why it would not work.

    Results: After this exercise, you should have assessed the strategy.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    33/195

    Lab Instructions: Backup of SQL Server 2012 Databases 1

    Module 6

    Lab Instructions: Backup of SQL Server 2012 Databases

    Contents:

    Exercise 1: Investigate Backup Compression 3

    Exercise 2: Transaction Log Backup 3

    Exercise 3: Differential Backup 4

    Exercise 4: Copy-only Backup 4

     

    Challenge Exercise 5: Partial Backup (Only if time permits) 5 

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    34/195

    2 Lab Instructions: Backup of SQL Server 2012 Databases

    Lab 6: Backup of SQL Server Databases

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1.  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2. 

    In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and click

    SQL Server Management Studio.

    3.  In the Connect to Server window, type Proseware in the Server name text box.

    4. 

    In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5. 

    In the File menu, click Open, and click Project/Solution.

    6.  In the Open Project window, open the project

    D:\10775A_Labs\10775A_06_PRJ\10775A_06_PRJ.ssmssln .

    7.  From the View menu, click Solution Explorer. In Solution Explorer, double-click the query

    00-Setup.sql. When the query window opens, click Execute on the toolbar.

    Lab Scenario

    You have reviewed and updated the recovery models. As the database administrator, you need toimplement a database backup strategy. You have been provided with details of the required backup

    strategy for a number of databases on a SQL Server instance. You need to complete the required

    backups.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    35/195

      Lab Instructions: Backup of SQL Server 2012 Databases 3

    Exercise 1: Investigate Backup Compression

    Scenario

    The size of the database backups has been increasing with the number of orders being placed. You want

    to investigate the amount of space that can be saved by using backup compression. In this exercise, you

    need to investigate the effectiveness of backup compression when backing up the MarketDev database

    on the Proseware instance. You will perform a full database backup with backup compression disabled.

    You will then perform another full database backup with backup compression enabled. You will compare

    the backup files produced to identify the possible space savings.

    The main tasks for this exercise are as follows:

    1. 

    Create a database backup without compression.

    2. 

    Create a database backup with compression.

    3.  Compare the file sizes created.

      Task 1: Create a database backup without compression

    •  Using Windows Explorer, create a new folder L:\SQLBackups.

    •  Perform a full backup of the MarketDev database with compression disabled to the file

    L:\SQLBackups\MarketDev_Full_Uncompressed.BAK.

      Task 2: Create a database backup with compression

    •  Perform a full backup of the MarketDev database with compression enabled to the file

    L:\SQLBackups\MarketDev_Full_Compressed.BAK.

      Task 3: Compare the file sizes created

    •  Calculate the space savings provided by compression as:

    SpaceSavings=(Uncompressed size–Compressed size)*100/Uncompressed size

    Results: After this exercise, you have calculated the space saved by using backup compression on theMarketDev database.

    Exercise 2: Transaction Log Backup

    Scenario

    Part of the ongoing management of the MarketDev database is a series of transaction log backups to

    provide point in time recovery. In this exercise, you need to back up the transaction log.

    The main tasks for this exercise are as follows:

    1. 

    Execute a script to introduce workload to the MarketDev database.

    2. 

    Backup the transaction log on the MarketDev database.

      Task 1: Execute a script to introduce workload to the MarketDev database

    •  Open and execute the script file 61 – Workload File.sql from Solution Explorer.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    36/195

    4 Lab Instructions: Backup of SQL Server 2012 Databases

      Task 2: Backup the transaction log on the MarketDev database

    • 

    Backup the transaction log of the MarketDev database to the file

    L:\SQLBackups\MarketDev_Log_Compressed.BAK. Use backup compression during the backup.

    Results: After this exercise, you should have completed a transaction log backup.

    Exercise 3: Differential Backup

    Scenario

    There is a concern that the data volumes in the MarketDev database will be so large that daily full

    backups will not be possible. In this exercise, you need to perform a differential backup to assist to

    manage the size of the database backups.

    The main tasks for this exercise are as follows:

    1. 

    Execute a script to introduce workload to the MarketDev database.

    2. 

    Create a differential backup of the MarketDev database.

     

    Task 1: Execute a script to introduce workload to the MarketDev database•  Open and execute the script file 61 – Workload File.sql from Solution Explorer.

      Task 2: Create a differential backup of the MarketDev database

    •  Create a differential backup of the MarketDev database to the file

    L:\SQLBackups\MarketDev_Differential_Compressed.BAK. Use backup compression during the backup.

    • 

    Using Windows Explorer, note the size of the Differential backup compared to the Full backup.

      Task 3: Execute a script to introduce workload to the MarketDev database

    •  Open and execute the script file 61 – Workload File.sql from Solution Explorer.

      Task 4: Append a differential backup to the previous differential backup file

    •  Append a differential backup of the MarketDev database to the file

    L:\SQLBackups\MarketDev_Differential_Compressed.BAK.

    •  Using Windows Explorer, note that the size of the Differential backup has increased. The file now

    contains two backups.

    Results: After this exercise, you should have completed two differential backups.

    Exercise 4: Copy-only Backup

    Scenario

    Another team periodically needs a temporary copy of the MarketDev database. It is important that these

    copies do not interfere with the backup strategy that is being used. In this exercise, you need to perform acopy-only backup and verify the backup.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    37/195

      Lab Instructions: Backup of SQL Server 2012 Databases 5

    The main task for this exercise is as follows:

    1. 

    Create a copy-only backup of the MarketDev database, ensuring to choose to verify the backup.

      Task 1: Create a copy-only backup of the MarketDev database, ensuring to choose to

    verify the backup

    • 

    Create a copy-only backup of the MarketDev database to the fileL:\SQLBackups\MarketDev_Copy_Compressed.BAK. Make sure you choose to:

    •  Verify the backup while creating it.

    • 

    Use backup compression.

    •  Choose to create a new media set called MarketDev Copy Backup.

    •  For the media set description use MarketDev Copy Backup for Integration Team.

    Results: After this exercise, you should have completed a copy-only backup.

    Challenge Exercise 5: Partial Backup (Only if time permits)

    Scenario

    On the Proseware instance, there is a database called RateTracking that has two filegroups. The ARCHIVE

    filegroup is set to read-only and both the default filegroup USERDATA and the PRIMARY filegroup are

    read-write. In this exercise, you need to back up the read-write filegroups only, using T-SQL commands.

    The main task for this exercise is as follows:

    1. 

    Perform a backup of the read-write filegroups on the RateTracking database.

      Task 1: Perform a backup of the read-write filegroups on the RateTracking database

    •  Perform a backup of the read-write filegroups (USERDATA and PRIMARY) on the RateTracking

    database. Write the backup to the file L:\SQLBackups\RateTracking_ReadWrite.BAK. Use the

    CHECKSUM and INIT options.

    Results: After this exercise, you should have completed a partial backup.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    38/195

    Lab Instructions: Restoring SQL Server 2012 Databases 1

    Module 7

    Lab Instructions: Restoring SQL Server 2012 Databases

    Contents: 

    Exercise 1: Determine a Restore Strategy 3

    Exercise 2: Restore the Database 3 

    Challenge Exercise 3: Using STANDBY Mode (Only if time permits) 4 

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    39/195

    2 Lab Instructions: Restoring SQL Server 2012 Databases

    Lab 7: Restoring SQL Server 2012 Databases

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1. 

    Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2.  In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and clickSQL Server Management Studio.

    3. 

    In the Connect to Server window, type Proseware in the Server name text box.

    4. 

    In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5.  In the File menu, click Open, and click Project/Solution.

    6. 

    In the Open Project window, open the projectD:\10775A_Labs\10775A_07_PRJ\10775A_07_PRJ.ssmssln .

    7. 

    From the View menu, click Solution Explorer. In Solution Explorer, double-click the query00-Setup.sql. When the query window opens, click Execute on the toolbar.

    Note  The setup script for this module is intended to throw an error regarding missingfiles. This is normal.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    40/195

      Lab Instructions: Restoring SQL Server 2012 Databases 3

    Lab Scenario

    You have been provided with a series of backups taken from a database on another server that you need

    to restore to the Proseware, Inc. server with the database name MarketYields. The backup file includes a

    number of full, differential, and log backups. You need to identify backups contained within the file,

    determine which backups need to be restored, and perform the restore operations. When you restore the

    database, you need to ensure that it is left as a warm standby, as additional log backups may be applied

    at a later date.

    If you have time, you should test the standby operation.

    Exercise 1: Determine a Restore Strategy

    Scenario

    You need to restore a database backup from another instance to the Proseware instance. You have been

    provided with a backup file containing multiple full, differential, and log backups. In this exercise you

    need to determine which backups are contained within the file and determine which backups need to be

    restored and in which order.

    The main tasks for this exercise are as follows:1.

     

    Review the backups contained within the backup file.

    2.  Determine how the restore should be performed.

      Task 1: Review the backups contained within the backup file

    • 

    Use the HEADERONLY option of the RESTORE command to identify the backups that are contained

    within the file D:\MSSQLSERVER\MarketYields.bak.

      Task 2: Determine how the restore should be performed

    • 

    Determine which backup need to be restored and in which order.

    Results: After this exercise, you should have identified the backups that need to be restored.

    Exercise 2: Restore the Database

    Scenario

    You have determined which backups need to be restored. You now need to restore the database

    MarketYields to the Proseware instance from the backups that you have decided upon. You will leave the

    database in STANDBY mode.

    The main task for this exercise is as follows:

    1. 

    Restore the database.

      Task 1: Restore the database

    •  Using SSMS, restore the MarketYields database using the backups that you determined were

    needed in Exercise 1. Make sure you use the STANDBY option with a STANDBY filename of

    L:\MKTG\Log_Standby.bak. You will need to move the mdf file to the folder D:\MKTG and the ldf file

    to the folder L:\MKTG.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    41/195

    4 Lab Instructions: Restoring SQL Server 2012 Databases

    •  In Object Browser refresh the list of databases and check the status of the MarketYields database on

    the Proseware instance.

    Results: After this exercise, you should have restored the database in STANDBYmode.

    Challenge Exercise 3: Using STANDBY Mode (Only if time permits)

    Scenario

    In this exercise, you will ensure that the STANDBY mode works as expected. You will access the database

    and then restore another log file to make sure the database can continue to be restored.

    The main tasks for this exercise are as follows:

    1.  Execute queries against the STANDBY database to ensure it is accessible.

    2. 

    Restore another log file, leaving the database in STANDBY mode.

      Task 1: Execute queries against the STANDBY database to ensure it is accessible

    •  Open a query window against the MarketYields database on the Proseware instance.

    •  Select a count of the rows in the LogData table.

    • 

    Close the query window.

      Task 2: Restore another log file, leaving the database in STANDBY mode

    •  Restore the log file D:\MSSQLSERVER\MarketYields_log.bak. Ensure you leave the database in

    STANDBY mode.

    •  In Object Browser refresh the list of databases and check the status of the MarketYields database on

    the Proseware instance.

    Results: After this exercise, you should have tested the STANDBY capability.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    42/195

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    43/195

    2 Lab Instructions: Importing and Exporting Data

    Lab 8: Importing and Exporting Data

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1.  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2. 

    In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and click

    SQL Server Management Studio.

    3.  In the Connect to Server window, type Proseware in the Server name text box.

    4. 

    In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5. 

    In the File menu, click Open, and click Project/Solution.

    6.  In the Open Project window, open the project

    D:\10775A_Labs\10775A_08_PRJ\10775A_08_PRJ.ssmssln .

    7.  From the View menu, click Solution Explorer. In Solution Explorer, double-click the query

    00-Setup.sql. When the query window opens, click Execute on the toolbar.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    44/195

      Lab Instructions: Importing and Exporting Data 3

    Lab Scenario

    Proseware regularly receives updates of currencies and exchange rates from an external provider. One of

    these files is provided as an Excel spreadsheet, the other file is provided as a comma-delimited text file.

    You need to import both these files into tables that will be used by the Direct Marketing team within

    Proseware.

    Periodically the Marketing team requires a list of prospects that have not been contacted within the lastmonth. You need to create and test a package that will extract this information to a file for them.

    You are concerned about the import performance for the exchange rate file and you are considering

    disabling constraints and indexes on the exchange rate table during the import process. If you have time,

    you will test the difference in import performance.

    Supporting Documentation

    Exercise 1

    Item Description

    Output table DirectMarketing.Currency

    Output columns CurrencyID int not null

    CurrencyCode nvarchar(3) not null

    CurrencyName nvarchar(50) not null

    Input file D:\10775A_Labs\10775A_08_PRJ\10775A_08_PRJ\Currency.xls

    Exercise 1: Import the Excel Spreadsheet

    Scenario

    You need to load a file of currency codes and names from an Excel spreadsheet. In this exercise, you willuse the import wizard to perform the data load.

    The main task for this exercise is as follows:

    1. 

    Import the data using the Import Wizard.

      Task 1: Import the data using the Import Wizard

    •  Import the spreadsheet Currency.xls into a table in the MarketDev database called

    DirectMarketing.Currency. If the table already exists, delete the table first. Refer to the Supporting

    Documentation for the file location and output table format.

    •  Query the DirectMarketing.Currency table to see that the data that was loaded.

    Results: After this exercise, you should have imported the DirectMarketing.Currency table.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    45/195

    4 Lab Instructions: Importing and Exporting Data

    Exercise 2: Import the CSV File

    Scenario

    You have also been provided with a comma-delimited file of exchange rates. You need to import these

    exchange rates into the existing DirectMarketing.ExchangeRate table. The table should be truncated

    before the data is loaded.

    The main task for this exercise is as follows:

    1. 

    Import the CSV file.

    Note  Make sure that you record how long the command takes to execute. Warning: it will

    take several minutes to complete. Use this time to prepare for the next Exercise.

      Task 1: Import the CSV file

    •  Truncate the DirectMarketing.ExchangeRate table.

    • 

    Review the ExchangeRates.xml format file in the Solution Explorer.

    • 

    Using BULK INSERT T-SQL command import the ExchangeRates.csv file into the tableDirectMarketing.ExchangeRate. The ExchangeRates.csv file can be found in the following location:

    D:\10775A_Labs\10775A_08_PRJ\10775A_08_PRJ\ExchangeRates.csv.

    •  Use ExchangeRates.xml as the format file and a batch size of 10,000, and use the option to skip the

    first row as it contains headings.

    Results: After this exercise, you should have imported the ExchangeRate table using T-SQL BULKINSERT statement.

    Exercise 3: Create and Test an Extraction Package

    Scenario

    Periodically the Marketing team requires a list of prospects that have not been contacted within the last

    month. You need to create and test a package that will extract this information to a file for them.

    The main task for this exercise is as follows:

    1.  Create and test an extraction package.

      Task 1: Create and test an extraction package

    • 

    Using the Export Wizard, export the Marketing.Prospect table to a text file in the following location:

    D:\MKTG\ProspectsToContact.csv. Column Names should be included in the first row. The extraction

    query should be as shown in the snippet below:

    SELECT ProspectID, FirstName, LastName, CellPhoneNumber,

    WorkPhoneNumber,EmailAddress, LatestContactFROM Marketing.Prospect

    WHERE LatestContact < DATEADD(MONTH,-1,SYSDATETIME())

    OR LatestContact IS NULL

    ORDER BY ProspectID;

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    46/195

      Lab Instructions: Importing and Exporting Data 5

    Note  Save the SSIS package that is created by the Export Wizard to SQL Server in the

    package root location.

    Results: After this exercise, you should have created and tested an extraction package.

    Challenge Exercise 4: Compare Loading Performance (Only if time permits)

    Scenario

    You are concerned about the import performance for the exchange rate file and you are considering

    disabling constraints and indexes on the exchange rate table during the import process. If you have time,

    you will test the difference in import performance.

    The main task for this exercise is as follows:

    1. 

    Re-execute load with indexes disabled.

      Task 1: Re-execute load with indexes disabled

    •  Alter your script from Exercise 2 to disable any non-clustered indexes on the

    DirectMarketing.ExchangeRate table before loading the data and to rebuild the indexes after the loadcompletes.

    •  Execute your modified script and compare the duration to the value recorded in Exercise 2.

    Results: After this exercise, you should have compared the load performance with indexesdisabled.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    47/195

    Lab Instructions: Authenticating and Authorizing Users 1

    Module 9

    Lab Instructions: Authenticating and Authorizing Users

    Contents:

    Exercise 1: Create Logins 4 

    Exercise 2: Correct an Application Login Issue 5 

    Exercise 3: Create Database Users 5 

    Challenge Exercise 4: Correct Access to Restored Database(Only if time permits) 6

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    48/195

    2 Lab Instructions: Authenticating and Authorizing Users

    Lab 9: Authenticating and Authorizing Users

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1.  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2.  In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and click

    SQL Server Management Studio.

    3.  In the Connect to Server window, type Proseware in the Server name text box.

    4.  In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5. 

    In the File menu, click Open, and click Project/Solution.

    6.  In the Open Project window, open the project

    D:\10775A_Labs\10775A_09_PRJ\10775A_09_PRJ.ssmssln.

    7.  From the View menu, click Solution Explorer. In Solution Explorer, double-click the query

    00-Setup.sql. When the query window opens, click Execute on the toolbar.

    Lab Scenario

    You need to configure the security for the Marketing database prior to the business accessing the system.You need to configure security so that organizational users are able to connect to SQL Server but are only

    to access resources that they are permitted to access. Most users will connect using their Windows group

    credentials. Some users however will need to use individual Windows logins. An application requires the

    use of a SQL Server login.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    49/195

      Lab Instructions: Authenticating and Authorizing Users 3

    If you have time there is a problem with the LanguageDetails database that you should try to solve.

    Note  The changes you make will later be migrated to the production environment. Youshould use T-SQL commands to implement the required changes.

    Supporting Documentation

    Existing Windows User and Group Structure

    ITSupport  SalesPeople  CreditManagement  HumanResources  CorporateManagers 

    David.Alexander X  X 

    Jeff.Hay  X 

    Palle.Petersen 

    Terry.Adams  X 

    Darren.Parker  X  X 

    Mike.Ray  X 

    April.Reagan  X 

    Jamie.Reding  X 

    Darcy.Jayne  X 

    Naoki.Sato 

    Bjorn.Rettig  X  X 

    Don.Richardson  X 

    Wendy.Kahn  X 

    Neil.Black   X  X 

    Madeleine.Kelly  X 

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    50/195

    4 Lab Instructions: Authenticating and Authorizing Users

    Pre-existing Security Configuration

    •  The SQL Login PromoteApp has been created.

    Security Requirements

    Note: this list of security requirements applies to several modules. For this module, you only need to

    consider those requirements that can be satisfied by topics covered in this module and the assigned tasks

    in the lab instructions.

    1. 

    The senior DBA Jeff Hay should have full access to and control of the entire Proseware server instance.

    2.  All ITSupport group members should have full access to and control of the MarketDev database.

    3.  Proseware uses an application called DBMonitor from Trey Research. This application requires a SQL

    login called DBMonitorApp, which requires the ability to read but not update all objects in the

    MarketDev database. It does not require access to other databases.

    4. 

    All CorporateManagers group members perform periodic Strength, Weakness, Opportunity, and

    Threat (SWOT) analysis. For this they need to be able to both read and update rows in the

    DirectMarketing.Competitor table.

    5. 

    All SalesPeople group members should be able to read data from all tables in the DirectMarketingschema, except April Reagan who is a junior work experience student.

    6. 

    Only ITSupport group members and members of the CreditManagement group should be able to

    update the Marketing.CampaignBalance table directly.

    7. 

    Within the company members of the SalesPeople group, the CreditManagement group, and the

    CorporateManagers group are referred to as sales team members.

    8.  All sales team members should be able to read rows in the Marketing.CampaignBalance table.

    9. 

    All sales team members should be able to read rows in the DirectMarketing.Competitor table.

    10.  The Sales Manager should be able to read and update the Marketing.SalesTerritory table.

    11. 

    All HumanResources group members should be able to read and update rows in theMarketing.SalesPerson table.

    12.  The Sales Manager should be able to execute the Marketing.MoveCampaignBalance stored

    procedure.

    13.  All sales team members should be able to execute all stored procedures in the DirectMarketing

    schema.

    Exercise 1: Create Logins

    Scenario

    You have been provided with the security requirements for the MarketDev database. In this exercise you

    need to create individual Windows logins, Windows group logins, and SQL logins that are required toimplement the security requirements.

    The main tasks for this exercise are as follows:

    1.  Review the requirements.

    2. 

    Create the required logins.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    51/195

      Lab Instructions: Authenticating and Authorizing Users 5

      Task 1: Review the requirements

    • 

    Review the supplied security requirements in the supporting documentation.

      Task 2: Create the required logins

    •  Create the logins that you have determined are required for the system. This will include Windowslogins, Windows group logins, and SQL logins.

    Results: After this exercise, you have created the required Windows and SQL logins.

    Exercise 2: Correct an Application Login Issue

    Scenario

    The Adventure Works IT department has implemented a new web application called Promote. ThePromote application requires a SQL login called PromoteApp. The SQL login needs to operate with a fixedpassword. The application has been operating for some time but has now stopped working. It appears theapplication is unable to log on to the Proseware server. You need to reset the password for thePromoteApp user and disable policy checking for the login.

    The main task for this exercise is as follows:

    1.  Correct an Application Login Issue.

      Task 1: Correct an application login issue

    • 

    Reset the password for the PromoteApp SQL login to “Pa$$w0rd”.

    •  Disable policy checking for the application login.

    Results: After this exercise, you have corrected an application login issue.

    Exercise 3: Create Database Users

    ScenarioYou have created the required logins for the Proseware server as per the security requirements that youhave been supplied. You need to create database users for those logins in the MarketDev database.

    The main tasks for this exercise are as follows:

    1.  Review the requirements.

    2.  Create the required database users.

      Task 1: Review the requirements

    •  Review the supplied security requirements in the supporting documentation.

      Task 2: Create the required database users

    • 

    Create the database users that you have determined are required for the MarketDev database.

    Results: After this exercise, you should have created the required database users. 

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    52/195

    6 Lab Instructions: Authenticating and Authorizing Users

    Challenge Exercise 4: Correct Access to Restored Database (Only if timepermits)

    Scenario

    A junior DBA has been trying to restore the LanguageDetails database and grant access to a SQL loginnamed LDUser. He was able to restore the database and to create the login but he has been unable to

    create the database user. He suspects that something in the existing database is preventing this as he cancreate and assign other SQL logins without issue. You need to restore the LanguageDetails database,create the LDUser login, create the LDUser database user, and test that the user can access the database.

    The main task for this exercise is as follows:

    1.  Correct Access to a Restored Database.

      Task 1: Correct Access to a restored database

    •  Restore the LanguageDetails database from the fileD:\10775A_Labs\10775A_09_PRJ\LanguageDetails.bak to the Proseware server instance.

    •  Create the login LDUser with policy checking disabled and a password of “Pa$$w0rd”.

     

    Correct access to the LanguageDetails database for the LDUser database user.•  Test that the LDUser login can access the database and can select the rows from the dbo.Language

    table.

    Results: After this exercise, you should have resolved the situation.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    53/195

    Lab Instructions: Assigning Server and Database Roles 1

    Module 10

    Lab Instructions: Assigning Server and Database Roles

    Contents:

    Exercise 1: Assign Server Roles 5 

    Exercise 2: Assign Fixed Database Roles 5 

    Exercise 3: Create and Assign User-defined Database Roles 6 

    Challenge Exercise 4: Check Role Assignments (Only if time permits) 6 

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    54/195

    2 Lab Instructions: Assigning Server and Database Roles

    Lab 10: Assigning Server and Database Roles

    Lab Setup

    For this lab, you will use the available virtual machine environment. Before you begin the lab, you must

    complete the following steps:

    1.  Revert the virtual machines as per the instructions in D:\10775A_Labs\Revert.txt.

    2. 

    In the virtual machine, click Start, click All Programs, click Microsoft SQL Server 2012, and click

    SQL Server Management Studio.

    3.  In the Connect to Server window, type Proseware in the Server name text box.

    4. 

    In the Authentication drop-down list box, select Windows Authentication and click Connect.

    5. 

    In the File menu, click Open, and click Project/Solution.

    6.  In the Open Project window, open the project

    D:\10775A_Labs\10775A_10_PRJ\10775A_10_PRJ.ssmssln.

    7.  From the View menu, click Solution Explorer. In Solution Explorer, double-click the query

    00-Setup.sql. When the query window opens, click Execute on the toolbar.

    Lab Scenario

    You have created the SQL Server logins and Database users. You now need to assign the logins and usersto the required roles based upon the security requirements for the MarketDev database. You should

    assign the minimum level of access that will allow each user to perform their job. This will require a

    combination of server, fixed database, and user defined database roles.

    Do not be concerned with object and schema permissions as these will be assigned in Module 11 but you

    do need to consider the role requirements that will be required at that time.

    Note  The changes you make will later be migrated to the production environment. You

    should use T-SQL commands to implement the required changes.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    55/195

      Lab Instructions: Assigning Server and Database Roles 3

    Supporting Documentation

    Existing Windows User and Group Structure

    ITSupport  SalesPeople  CreditManagement  HumanResources  CorporateManagers 

    David.Alexander X  X 

    Jeff.Hay  X 

    Palle.Petersen  X 

    Terry.Adams 

    Darren.Parker 

    Mike.Ray  X 

    April.Reagan  X 

    Jamie.Reding  X 

    Darcy.Jayne  X 

    Naoki.Sato  X 

    Bjorn.Rettig 

    Don.Richardson 

    Wendy.Kahn  X 

    Neil.Black   X  X 

    Madeleine.Kelly  X 

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    56/195

    4 Lab Instructions: Assigning Server and Database Roles

    Pre-existing Security Configuration

    •  The following Windows group logins and database users have been created:

    •  AdventureWorks\ITSupport

    •  AdventureWorks\SalesPeople

    • 

    AdventureWorks\CreditManagement

    •  AdventureWorks\HumanResources

    •  AdventureWorks\CorporateManagers

    •  The following Windows logins and database users have been created:

    • 

    AdventureWorks\Jeff.Hay

    •  AdventureWorks\April.Reagan

    •  AdventureWorks\Darren.Parker

    • 

    The following SQL logins have been created:

    • 

    PromoteApp

    •  DBMonitorApp

    Security Requirements

    1.  The senior DBA Jeff Hay should have full access to and control of the entire Proseware server instance.

    2. 

    All ITSupport group members should have full access to and control of the MarketDev database.

    3. 

    Proseware uses an application called DBMonitor from Trey Research. This application requires a SQL

    login called DBMonitorApp, which requires the ability to read but not update all objects in the

    MarketDev database.

    4.  All CorporateManagers group members perform periodic Strength, Weakness, Opportunity, and

    Threat (SWOT) analysis. For this they need to be able to both read and update rows in theDirectMarketing.Competitor table.

    5. 

    All SalesPeople group members should be able to read data from all tables in the DirectMarketing

    schema, except April Reagan who is a junior work experience student.

    6.  Only ITSupport group members and members of the CreditManagement group should be able to

    update the Marketing.CampaignBalance table directly.

    7.  Within the company members of the SalesPeople group, the CreditManagement group, and the

    CorporateManagers group are referred to as sales team members.

    8.  All sales team members should be able to read rows in the Marketing.CampaignBalance table.

    9.  All sales team members should be able to read rows in the DirectMarketing.Competitor table.

    10. 

    The Sales Manager should be able to read and update the Marketing.SalesTerritory table.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    57/195

      Lab Instructions: Assigning Server and Database Roles 5

    11.  All HumanResources group members should be able to read and update rows in the

    Marketing.SalesPerson table.

    12.  The Sales Manager should be able to execute the Marketing.MoveCampaignBalance stored

    procedure.

    13. 

    All sales team members should be able to execute all stored procedures in the DirectMarketing

    schema.

    Exercise 1: Assign Server Roles

    Scenario

    You need to implement any required server roles that are needed to support the supplied security

    requirements.

    The main tasks for this exercise are as follows:

    1. 

    Review the requirements.

    2. 

    Assign any required server roles.

     

    Task 1: Review the requirements

    •  Review the supplied security requirements in the supporting documentation.

      Task 2: Assign any required server roles

    •  Assign any server roles that are required to support the security requirements for the MarketDev

    database.

    Results: After this exercise, you should have assigned any required server roles.

    Exercise 2: Assign Fixed Database Roles

    ScenarioYou have been provided with a set of requirements detailing the access that each login needs to the

    MarketDev database. Some of these requirements might be met by fixed database roles but it is

    important to not provide permissions that are not specifically required. If you consider there is a need for

    user-defined database roles these will be created in the next exercise.

    The main tasks for this exercise are as follows:

    1.  Review the requirements.

    2. 

    Assign any required fixed database roles.

      Task 1: Review the requirements

    •  Review the supplied security requirements in the supporting documentation.

      Task 2: Assign any required fixed database roles

    • 

    Assign any fixed database roles that are required to support the security requirements for the

    MarketDev database.

    Results: After this exercise, you have assigned fixed database roles as required.

  • 8/9/2019 31019710775AD-ENU-LabM.pdf

    58/195

    6 Lab Instructions: Assigning Server and Database Roles

    Exercise 3: Create and Assign User-defined Database Roles

    Scenario

    You have been provided with a set of requirements detailing the access that each login needs to the

    MarketDev database. In Exercise 2, you assigned fixed database role membership. Other requirements

    might be best supported by user-defined database roles. In this exercise you will create and assign

    required user-defined database roles.

    The main tasks for this exercise are as follows:

    1.  Review the requirements.

    2. 

    Create and assign any required user-defined database roles.

      Task 1: Review the requirements

    •  Review the supplied security requirements in the supporting documentation.

      Task 2: Create and assign any required user-defined database roles

    • 

    Create and assign any user-defined database roles that are required to support the security

    requirements for the MarketDev database.

    Results: After this exercise, you have created and assigned user-defined databaseroles as required.

    Challenge Exercise 4: Check Role Assignments (Only if time permits)

    Scenario

    You have created logins and database users, assigned server and database roles, and created and assigned

    user-defined database roles. It is important to check that the role assignments are operating as expected.

    In this exercise you will use the sys.login_token and sys.user_token system views to check the available

    tokens for Darren Parker.

    The main task for this exercise is as follows:

    1.  Check the role assignments for Darren Parker.

      Task 1: Check the role assignments for Darren Parker

    •  Using the EXECUTE AS statement, change your security context to the login

    AdventureWorks\Darren.Parker.

    •  Query the s