administering microsoft sql server 2012 databases jumpstart-mod 3_final

Upload: dale-mclaughlin

Post on 15-Oct-2015

195 views

Category:

Documents


0 download

TRANSCRIPT

PowerPoint Presentation

Course TopicsAdministering SQL Server 2012 Jump Start01 | Install and Configure SQL Server04 | Manage Data02 | Maintain Instances and Databases05 | Implement Security03 | Performance Optimization and Troubleshooting06 | High Availability Options

103 | Performance Optimization and TroubleshootingGeorge Squillace | Senior Technical Trainer New Horizons Great LakesRichard Currey | Senior Technical Trainer New Horizons UnitedClick to edit Master subtitle style2Module 3 Overview Locking, Blocking, and DeadlocksProfilerAuditingCatalog Views and DMOsData Collector and the Management Data Warehouse

3Topic: Locking, Blocking and Deadlocks4Topic: Locking, Blocking, and DeadlocksWhat Are Locking, Blocking, and Deadlocks?How Are Locking Problems Discovered and Solved?

5What Are Locking, Blocking, and Deadlocks?Resource locking is a data integrity mechanism that restricts access to various objects while under modification and not yet committedLocking is natural and expectedExamples of lockable resources are:Key valuesRowsPagesTablesFilesDatabasesBlocking occurs when one connection is waiting for other connections to release locked resourcesSome blocking is expectedExcessive blocking is undesirableA deadlock occurs when two connections have locked resources that are seeking each others locked resources before their respective transactions complete; this results in the termination of one of the connections6How Are Locking Problems Discovered and Solved?Deadlock problems discovered by:Client error messagesActivity monitorDMOsProfilerTrace flagsExtended EventsDeadlock problems are solved by (OK, minimized by):Order of objects accessed within queries / sprocsKeeping transactions shortIsolation levelAvoiding user interaction (data browsing) during transactions7Using Activity Monitor to Detect a Blocked Connection DEMO8Topic: Profiler9Topic: ProfilerWhat Is Tracing?What Is Profiler?10What Is Tracing?Tracing permits the recording of a wide range of SQL Server activity (events within event classes) to filesSampling of event classes and eventsClass 1Event 1Event 2Class 2Event 3Event 4Based on the use of many system stored procedures

11What Is Profiler?Graphical user interface into the tracing stored proceduresThe three legs of the profiler configurationEvent classes and eventsColumnsFiltersIntegrate Windows Perfmon data with profiler dataSimple-Talk eBook on Profiler

12Using Profiler to Capture a Deadlock GraphDEMO13Topic: Auditing 14Topic: AuditingC2 and Common CriteriaAuditing with TriggersSQL Auditing15C2 and Common CriteriaOlder methodsC2, sp_Configure with C2 audit modeCommon criteria, sp_Configure with common criteria compliance enabledMuch overhead associated with these methods16Auditing with TriggersDML triggersWrite to a designated audit table on the basis of modificationsDDL triggersEventData() functionLogin triggersTrigger limitations

17SQL AuditingWhat does this feature provide compared to other types of general auditing methods?Based on extended events featureTerminologyServer vs. databaseWhat are the configuration steps?

18Configuring SQL AuditingDEMO19Topic: Catalog Views and DMOs20Topic: Catalog Views and DMOs

Purpose of catalog views and dynamic management objects (DMOs)Classification of DMOsResources for further exploration

21Purpose of Catalog Views and DMOs

What is metadata retrieval?Metadata retrieval methods that have been available in the pastGUIobtain information on one object at a timeSystem Stored Procscant really customizeSystem Functionsgenerally retrieve information one property at a timeIn more recent versionsCatalog views and DMOsStandard query language clausesCan customize columns retrievedCan customize rows retrievedCan aggregate and orderCan join with multiple catalogs

22Classification of DMOsDMO (general classification)sys.dm_ prefixDynamic management viewsNo input acceptedsys.dm_ prefixDynamic management functionsInput accepted and often requiredsys.dm_ prefix

23Resources for Further ExplorationSimple Talk eBook by Louis Davidson and Tim FordTim Fords Periodic Table of Dynamic Management Objects presentation at PASS SQL Rally May 2012The Redgate DMV Starter PackQuest Poster

24Querying Dynamic Management ObjectsDEMO25Topic: Data Collector and the Management Data Warehouse 26Topic: Data Collector and the Management Data WarehouseOverview of Data CollectorConfiguring Data CollectorConsuming Data Collector Data27Overview of Data CollectorCollects capacity planning and performance data over timeProblem: DMO data isnt persistentFact: Troubleshooting is difficult when normal hasnt been establishedSolution: Management Data Warehouse (MDW)The MDW is created and configured using two wizards The wizard creates SSIS packages, jobs and schedules to collect performance planning and capacity data The MDW accommodates multiple servers Very useful reports available from the MDW database in SSMS

28Configuring Data CollectorExecute two wizardsWizard 1: Create the Management Data WarehouseWizard 2: Set Up Data CollectionData to be collectedFrequency of collectionRetention periodSpecific database roles exist for managementmdw_Adminmdw_writermdw_readerSpecific database roles exist for configurationDc_adminDc_operatorDc_proxy

29Consuming Data Collector DataReports available in SSMSDisk usage reportServer activity reportQuery statistics report

30Configuring the Management Data WarehouseDEMO312013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.32