Lab Answer Key for Module 1: Creating Databases and Database Files

Similar documents
Lab Answer Key for Module 8: Implementing Stored Procedures

Module 1: Creating Databases and Database Files

Module 7: Automating Administrative Tasks

Expression Design Lab Exercises

Microsoft Exchange Server SMTPDiag

Exclaimer Mail Archiver

Installation guide. WebChick. Installation guide for use on local PC

A SharePoint Developer Introduction. Hands-On Lab. Lab Manual HOL5 Using Client OM and REST from.net App C#

Receive and Forward syslog events through EventTracker Agent. EventTracker v9.0

Product Update: ET82U16-029/ ET81U EventTracker Enterprise

Visual Studio.NET Academic Assignment Manager Source Package

x10data Application Platform v7.1 Installation Guide

The Project Management Software for Outlook, Web and Smartphone

Installation and User Guide Worksoft Certify Content Merge

Getting Started with Tally.Developer 9 Alpha

Mobile On the Go (OTG) Server

HOTPin Software Instructions. Mac Client

Module 5: Integrating Domain Name System and Active Directory

Implementing and Supporting Windows Intune

INSTALLATION & OPERATIONS GUIDE Wavextend Calculation Framework & List Manager for CRM 4.0

ONVIF Server for Aimetis Symphony. Installation and Usage

CHECK PROCESSING. A Select Product of Cougar Mountain Software

Aimetis Symphony Mobile Bridge. 2.7 Installation Guide

Pipeliner CRM Arithmetica Guide Importing Accounts & Contacts Pipelinersales Inc.

RMH LABEL DESIGNER. Retail Management Hero (RMH)

x10data Smart Client 6.5 for Windows Mobile Installation Guide

Windows Server 2012 Immersion Experience Enabling Secure Remote Users with RemoteApp, DirectAccess, and Dynamic Access Control

Module 8: Implementing Stored Procedures

Steel-Belted Radius Installation Instructions for EAP-FAST Security Patch

Virtual Appliance Deployment Guide

Hands-On Lab: HORM. Lab Manual Expediting Power Up with HORM

x10data Smart Client 7.0 for Windows Mobile Installation Guide

Module 3-1: Building with DIRS and SOURCES

OEM Preinstallation Kit Guide for Microsoft Office 2013

Using the Orchestration Console in System Center 2012 R2 Orchestrator

RMH RESOURCE EDITOR USER GUIDE

6/29/ :38 AM 1

Server Installation Guide

SMB Live. Modernize with Hybrid Cloud. Lab 1: Exploring Windows Server 2012 R2 & Hyper-V

Microsoft Exchange 2000 Server Mailbox Folder Structure. Technical Paper

Marketing List Manager 2011

Connect Install Guide

KwikTag v4.6.4 Release Notes

INNOVATE. Creating a Windows. service that uses Microsoft Dynamics GP econnect to integrate data. Microsoft Dynamics GP. Article

Windows Server 2012: Manageability and Automation. Module 1: Multi-Machine Management Experience

Module 3: Managing Groups

Port Configuration. Configure Port of EventTracker Website

Aimetis Symphony. VE510 Metadata Analytic Setup

Deploying Windows 8.1 with ConfigMgr 2012 R2 and MDT 2013

How To Embed EventTracker Widget to an External Site

Implementing Hyper-V. Lab Exercises FINAL

Exclaimer Outlook Photos 1.0 Release Notes

Management Reporter Integration Guide for Microsoft Dynamics AX

Integrate Veeam Backup and Replication. EventTracker v9.x and above

Configuring TLS 1.2 in EventTracker v9.0

FileWay User s Guide. Version 3

ANALYZE. Business Analytics Technical White Paper. Microsoft Dynamics TM NAV. Technical White Paper

Deploying a System Center 2012 R2 Configuration Manager Hierarchy

Exclaimer Mail Disclaimers 1.0 Release Notes

Exclaimer Mail Disclaimers 1.0 Release Notes

Integrate Citrix Access Gateway

Microsoft Office Groove Server Groove Manager. Domain Administrator s Guide

Speed Lab 2! System Center 2012 R2: Introduction to Automation, Service & Application Management

RMH PRINT LABEL WIZARD

Senstar Symphony. 7.2 Installation Guide

Exclaimer Signature Manager 2.0 Release Notes

Integrating Imperva SecureSphere

Exclaimer Outlook Photos 2.0 Release Notes

Installation Guide Integrating Worksoft Certify with IBM Rational Quality Manager

Software Installation with Microsoft SQL 2008

Getting Started with Tally.Developer 9

Unloading Master Data from SAP BI 7.0 using Open Hub Service

Widgets for SAP BusinessObjects Business Intelligence Platform User Guide SAP BusinessObjects Business Intelligence platform 4.1 Support Package 2

Copyright ATRIL Language Engineering, SL. All rights reserved.

SECURE FILE TRANSFER PROTOCOL. EventTracker v8.x and above

Sage Residential Management. Moving Data Files Version 13.1

Symprex Out-of-Office Extender

Installation Guide. EventTracker Enterprise. Install Guide Centre Park Drive Publication Date: Aug 03, U.S. Toll Free:

Integrate Dell FORCE10 Switch

Microsoft Dynamics NAV

Cherwell Service Management

RMH GENERAL CONFIGURATION

HR-Lite Database & Web Service Setup Guide

Reliable High-Speed Connection to Publication Database for Synchronization

EventTracker: Backup and Restore Guide Version 9.x

Oracle Hospitality Suite8 Export to Outlook User Manual Release 8.9. July 2015

Microsoft Dynamics AX Team Server (ID Server) Setup Whitepaper for Microsoft. Dynamics AX 2009.

DC Detective. User Guide

Integrate Symantec Messaging Gateway. EventTracker v9.x and above

Getting Started with Tally.Developer 9 Series A Release 3.0

Copyright SolarWinds. All rights reserved worldwide. No part of this document may be reproduced by any means nor modified, decompiled,

Enhancement in Agent syslog collector to resolve sender IP Address EventTracker Enterprise

Integrate IIS SMTP server. EventTracker v8.x and above

How to Use DTM for Windows Vista System Logo Testing: A Step-by-Step Guide

Exclaimer Signature Manager 2.0 Release Notes

TaskCentre v4.5 SalesLogix Connector Tool White Paper

Deep Dive into Apps for Office in Outlook

What s New in BID2WIN Service Pack 4

Deploying Windows Server 2003 Internet Authentication Service (IAS) with Virtual Local Area Networks (VLANs)

Authlogics Forefront TMG and UAG Agent Integration Guide

Transcription:

Lab Answer Key for Module 1: Creating Databases and Database Files Table of Contents Lab 1: Creating Databases and Database Files 1 Exercise 1: Creating a Database 1 Exercise 2: Creating Schemas 4 Exercise 3: Creating a Database Snapshot 7

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. 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 are 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. 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. 2007 Microsoft Corporation. All rights reserved. Microsoft, BizTalk, Internet Explorer, Jscript, MSDN, Outlook, PowerPoint, SQL Server, Visual Basic, Visual C#, Visual C++, Visual FoxPro, Visual Studio, Windows and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. Version 1.0

Lab Answer Key for Module 1: Creating Databases and Database Files 1 Lab 1: Creating Databases and Database Files Exercise 1: Creating a Database Task 1: Create a SQL Server Management Studio Scripts project 1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL Server Management Studio. 2. In the Connect to Server dialog box, specify the values in the following table, and then click Connect. Server type Server name Authentication Database Engine MIAMI Windows Authentication 3. On the File menu, point to New, and then click Project. 4. In the New Project dialog box, specify the values in the following table, and then click OK. Name Location Create directory for solution or action AW_IT_Database D:\Labfiles\Starter Clear the check box 5. On the Project menu, click New Query. 6. In the Connect to Database Engine dialog box, specify the values in the following table, and then click Connect. Server name Authentication MIAMI Windows Authentication 7. If Solution Explorer is not visible, on the View menu, click Solution Explorer. 8. In Solution Explorer, right-click SQLQuery1.sql, click Rename, type CreateAW_IT_Assets.sql, and then press ENTER. Task 2: Create the new database with appropriate options and filegroups 1. If Object Explorer is not visible, on the View menu, click Object Explorer.

2 Lab Answer Key for Module 1: Creating Databases and Database Files 2. In Object Explorer, right-click Databases, and then click New Database. 3. In the New Database dialog box, in the Database name box, type AW_IT_Assets. 4. For the first database file, modify the details to match those in the following table. Logical Name File Type Filegroup AW_IT_Assets_Data1 Data PRIMARY Initial Size (MB) 20 5. In the Autogrowth column of the AW_IT_Assets_Data1 entry, click the ellipsis button ( ). 6. In the Change Autogrowth for AW_IT_Assets_Data1 dialog box, clear the Enable Autogrowth check box, and then click OK. 7. Click Add to create a new data file. 8. For the new database file, type in the details in the following table. Logical Name File Type AW_IT_Assets_Data2 Data Initial Size (MB) 20 9. In the Autogrowth column of the AW_IT_Assets_Data2 entry, click the ellipsis button ( ). 10. In the Change Autogrowth for AW_IT_Assets_Data2 dialog box, clear the Enable Autogrowth check box, and then click OK. 11. In the Filegroup column for the AW_IT_Assets_Data2 file, in the drop-down list, click <new filegroup>. 12. In the New Filegroup for AW_IT_Assets dialog box, type in the details in the following table, and then click OK. Name Options Default or action SECONDARY Select the check box 13. For the AW_IT_Assets_log entry, change the Initial Size setting to 5. 14. In the Autogrowth column of the AW_IT_Assets_log entry, click the ellipsis button ( ).

Lab Answer Key for Module 1: Creating Databases and Database Files 3 15. In the Change Autogrowth for AW_IT_Assets_log dialog box, clear the Enable Autogrowth check box, and then click OK. 16. In the New Database dialog box, on the toolbar, click the Script drop-down arrow, and then click Script Action to Clipboard. 17. When the scripting has completed successfully, click OK to create the new database. 18. Right-click in the CreateAW_IT_Assets.sql query window, and then click Paste. 19. On the File menu, click Save All. 20. Keep Microsoft SQL Server Management Studio open. You will use it in the next exercise.

4 Lab Answer Key for Module 1: Creating Databases and Database Files Exercise 2: Creating Schemas Task 1: Create the TechSupport schema 1. In SQL Server Management Studio, on the Project menu, click New Query. 2. In the Connect to Database Engine dialog box, specify the values in the following table, and then click Connect. Server name Authentication MIAMI Windows Authentication 3. In Solution Explorer, right-click SQLQuery1.sql, click Rename, type CreateAW_IT_Schemas.sql, and then press ENTER. 4. In Object Explorer, expand Databases, expand AW_IT_Assets, expand Security, right-click Schemas, and then click New Schema. 5. In the Schema New dialog box, in the Schema name box, type TechSupport but do not click OK yet. 6. On the toolbar, click the Script drop-down arrow, and then click Script Action to Clipboard. 7. When the scripting has completed successfully, click OK to create the schema. 8. Right-click in the CreateAW_IT_Schemas.sql query window, and then click Paste. 9. On the File menu, click Save All. Task 2: Create a new table and login by using the provided script 1. On the Project menu, click Add Existing Item. 2. In the Add Existing Item AW_IT_Database dialog box, browse to the D:\Labfiles\Starter folder, click the Create_AW_IT_Table_and_User.sql query file, and then click Add. 3. In the Connect to Database Engine dialog box, specify the values in the following table, and then click Connect. Server name Authentication MIAMI Windows Authentication 4. On the toolbar, click Execute to create the new Asset table and the login for MIAMI\Katie.

Lab Answer Key for Module 1: Creating Databases and Database Files 5 Task 3: Verify that the user can select information from the Asset table only by qualifying the table name with the schema 1. Click Start, click Run, type runas /noprofile /user:miami\katie cmd, and then click OK. 2. When prompted for the user password, type Pa$$w0rd, and then press ENTER. This creates a new Command Prompt window that is running as the MIAMI\Katie user account. 3. At the command prompt, type sqlcmd -S MIAMI -E, and then press ENTER. This starts the SQL Server 2005 command prompt, which allows you to execute statements against a database. 4. At the SQL Server 2005 command prompt, type each line of code, and then press ENTER. (sqlcmd will insert line numbers automatically.) USE AW_IT_Assets SELECT * FROM Asset GO An error message is displayed within the Command Prompt window because the dbo schema does not contain the Asset table. 5. At the SQL Server 2005 command prompt, type each line of code, and then press ENTER. USE AW_IT_Assets SELECT * FROM TechSupport.Asset GO Three records are displayed within the Command Prompt window because the statement includes the schema. 6. Do not close the Command Prompt window. Task 4: Change the default schemas for the users, and retest access to the table within the default schema 1. Switch back to SQL Server Management Studio. 2. In Object Explorer, expand Databases, expand AW_IT_Assets, and then expand Security. 3. Expand Users, right-click MIAMI\Katie, and then click Properties. 4. In the Database User MIAMI\Katie dialog box, in the Default schema box, type TechSupport, but do not click OK yet. 5. On the toolbar, click the Script drop-down arrow, and then click Script Action to Clipboard. 6. When the scripting has completed successfully, click OK to change the default schema for MIAMI\Katie.

6 Lab Answer Key for Module 1: Creating Databases and Database Files 7. In Solution Explorer, double-click CreateAW_IT_Schemas.sql. 8. Right-click in the CreateAW_IT_Schemas.sql query window under the existing script, and then click Paste. 9. On the File menu, click Save All. 10. Switch back the Command Prompt window that is running sqlcmd. 11. At the SQL Server 2005 command prompt, type each line of code, and then press ENTER. USE AW_IT_Assets SELECT * FROM Asset GO Three records are displayed within the Command Prompt window because the default schema for MIAMI\Katie is now TechSupport. 12. At the SQL Server 2005 command prompt, type Exit, and then press ENTER to close the sqlcmd connection. 13. At the command prompt, type Exit, and then press ENTER to close the Command Prompt window. 14. Keep SQL Server Management Studio open. You will use it in the next exercise.

Lab Answer Key for Module 1: Creating Databases and Database Files 7 Exercise 3: Creating a Database Snapshot Task 1: Create a database snapshot, and then compare the snapshot data file sizes before and after data modification 1. In SQL Server Management Studio, on the Project menu, click New Query. 2. In the Connect to Database Engine dialog box, specify the values in the following table, and then click Connect. Server name Authentication MIAMI Windows Authentication 3. In Solution Explorer, right-click SQLQuery1.sql, click Rename, type CreateAW_IT_Snapshot.sql, and then press ENTER. 4. In the new, blank query window, type the following Transact-SQL code. CREATE DATABASE AW_IT_Assets_Snapshot1 ON ( NAME = 'AW_IT_Assets_Data1', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AWIT1.ss'), ( NAME = N'AW_IT_Assets_Data2', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AWIT2.ss') AS SNAPSHOT OF AW_IT_Assets 5. On the File menu, click Save All. 6. On the toolbar, click Execute. 7. In Object Explorer, expand Databases, Database Snapshots, and then confirm that the new database snapshot exists. You might need to refresh the list of database snapshots before the new snapshot becomes visible. 8. Click Start, and then click Windows Explorer. 9. In the Microsoft Windows Explorer, browse to the C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data folder, right-click AWIT2.ss, and then click Properties. 10. In the AWIT2.ss Properties dialog box, note the current Size on disk value, and then click OK, but leave Windows Explorer open. 11. Switch back to SQL Server Management Studio, and then on the toolbar, click New Query. 12. In the new, blank query window, type the following Transact-SQL code. INSERT AW_IT_Assets.TechSupport.Asset (Description, Location) VALUES ('Workstation 2', 'Meeting Room 1') SELECT * FROM AW_IT_Assets.TechSupport.Asset SELECT *

8 Lab Answer Key for Module 1: Creating Databases and Database Files FROM AW_IT_Assets_Snapshot1.TechSupport.Asset 13. On the toolbar, click Execute, and then view the results. 14. Notice that the first result set contains four records and the second contains only three records, as expected. 15. Switch back to Windows Explorer. 16. In Windows Explorer, right-click AWIT2.ss, and then click Properties. 17. In the AWIT2.ss Properties dialog box, notice that the new Size on disk value is different from the previous value, and then click OK. 18. Close Windows Explorer. 19. Close SQL Server Management Studio. Click No if you are prompted to save files.