UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER...
Transcript of UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER...
![Page 1: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/1.jpg)
Microsoft TechNet Academy
UPDATING YOUR SQL
y
QSERVER 2005 SKILLS TO SQL SERVER 2008SQL SERVER 2008
![Page 2: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/2.jpg)
An Introduction to SQL Server 2008
• The Evolution of SQL Server
• Preparing for SQL Server 2008
![Page 3: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/3.jpg)
The Evolution of SQL Server
• SQL Server Version History
• SQL Server 2008 Editions
• Key Business Scenarios for SQL Server 2008
• What’s New in SQL Server 2008?
![Page 4: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/4.jpg)
SQL Server Version History
SQL Server 1.0 (1989)
Developed by Microsoft, Sybase, and Ashton-Tate for OS/2
SQL Server 4.2 (1992) Developed for Windows NT 3.1
SQL Server 6 0 First version designed specifically for Windows SQL Server 6.0 (1995)
First version designed specifically for Windows NT
SQL Server 7.0 (1999)
Total rewrite of code base resulted in f d l b l(1999) performance and scalability improvements
SQL Server 2000 Further improvements in performance, scalability, and reliability
SQL Server 2005New and improved features: Integration Services, Analysis Services, Notification Services, Reporting Services, XML support
![Page 5: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/5.jpg)
SQL Server 2008 Editions
For large-scale, business-critical applicationsEnterpriseEnterprise
F ll t di d t t l li tiSt d dSt d d For small to medium departmental applicationsStandardStandard
For small-scale branch applicationsWorkgroupWorkgroup
For entry-level and learning applicationsExpressExpress
For embedded databasesCompactCompact
For development and testingDeveloperDeveloper p g
![Page 6: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/6.jpg)
Key Business Scenarios for SQL Server 2008
Scalable BI platform optimized for data integration, reporting, and analysis
Business Intelligence
Business Intelligence
Comprehensive and scalable platform for faster storage and more data
Data Warehousing
Data Warehousing
Scalable, high-performance database engine for mission-critical, highly available, secure applications
OLTPOLTP
Comprehensive programming framework, including ADO.NET Entity Framework and LINQ
Application DevelopmentApplication
Development
Flexible, manageable, high-performance consolidation solutions
Server Consolidation
Server Consolidation
![Page 7: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/7.jpg)
What’s New in SQL Server 2008?
Configuration Servers
Configuration Servers
Policy-Based ManagementPolicy-Based Management Resource GovernorResource Governor
Data CollectorData Collector Plan FreezingPlan Freezing Transparent Data Encryption
Transparent Data Encryption
Auditing All Actions
Auditing All Actions
FILESTREAM Data Type
FILESTREAM Data Type Spatial DataSpatial Data
Hot Add CPUHot Add CPU Conflict DetectionConflict Detection Change Data Capture
Change Data Capturepp
MERGE StatementMERGE Statement Report DesignerReport Designer Analysis Services Wizards
Analysis Services WizardsWizardsWizards
![Page 8: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/8.jpg)
Preparing for SQL Server 2008
• Hardware and Software Requirements for SQL Server 2008
• Considerations for Installing SQL Server 2008Considerations for Installing SQL Server 2008
![Page 9: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/9.jpg)
Hardware and Software Requirements for SQL Server 2008
• Hardware:
Pentium III 2 GHz processor (32 bit or 64 bit)
1 GB 1 GB memory
280 MB disk space for a minimal install
• Software:
Windows XP SP2 Windows Server 2003 SP1 Windows Server Windows XP SP2, Windows Server 2003 SP1, Windows Server 2008, Windows Vista
Windows Installer 4.5 and MDAC 2.8 SP1
Internet Explorer 6 SP1
![Page 10: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/10.jpg)
Considerations for Installing SQL Server 2008
C ll ti h• Collation changes:Includes Far East collections that support supplementary characters
I l d bi d i t t dIncludes binary-code point sort order
Deprecation of Hindi and Lithuanian_Classic Windows collation
Deprecation of SQL_ALTDiction_CP1253_CS_AS SQL collation
• SQL Server 2008 will only coexist side by side with SQL Server 2005
• SQL Server Installation Center:Is available after installation
Provides links to requirements, documentation, installation Provides links to requirements, documentation, installation tasks, and maintenance tasks
![Page 11: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/11.jpg)
SQL Server 2008 Manageability Enhancements
• Central Management Servers
• Policy-Based Management
![Page 12: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/12.jpg)
Central Management Servers
• What Are Central Management Servers?
• How to Create a Central Management Server and Server GroupsGroups
• How to Execute Multiserver Queries
![Page 13: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/13.jpg)
What Are Central Management Servers?
• Centralized management of multiple servers:
Maintain connection information for servers in a server group:group:
Only Windows authentication is supported
Enable central administration of multiple servers:Enable central administration of multiple servers:
Multiserver queries
Policy-based managementMultiserver
Query
Configuration Server
Server Group
![Page 14: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/14.jpg)
How to Create a Central Management Server and Server Groups
1. Register a Central Management Server in the Registered Servers pane in SQL Server Management Studio
2 Create a new server group for the registered Central 2. Create a new server group for the registered Central Management Server
![Page 15: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/15.jpg)
How to Execute Multiserver Queries
Change Multiserver Results options as required
Create query from Registered Servers pane
By default, results are merged and include columns for
d l iserver and login
![Page 16: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/16.jpg)
Policy-Based Management
• What Is Policy-Based Management?
• What Are Facets, Conditions, and Targets?
• What Are Policies?
• Policy Execution Modes
• How to Create a Policy
• How to Apply Policies
• How to Evaluate Policies
• How to Assign Policies
![Page 17: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/17.jpg)
What Is Policy-Based Management?
Use the logical view that is provided through policies to define desired Management
by IntentManagement
by Intent g pconfiguration of data services proactivelyby Intentby Intent
Use policies to monitor, record, and optionally prevent changes from the d i d fi ti
Intelligent MonitoringIntelligent Monitoring desired configurationgg
Virtualized ManagementVirtualized
Management
By using policy-based management, you can scale management across multiple servers, which makes it easy to enforce consistent configuration policies across the enterprise
![Page 18: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/18.jpg)
What Are Facets, Conditions, and Targets?
An aspect of SQL Server management in which one or more related configuration FacetsFacets goptions is defined
Settings to define the state of a facetConditionsConditions
Entities such as servers, databases, logons, and other database objects to which policies can be applied
TargetTarget
![Page 19: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/19.jpg)
What Are Policies?
• A condition that is enforced on one or more targets
• Organized into categories
![Page 20: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/20.jpg)
Policy Execution Modes
• On demand
• Automated policy execution:
On schedule
On change: prevent
On change: log only
![Page 21: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/21.jpg)
How to Create a Policy
1. Create necessary conditions based on the appropriate facets or determine which preconfigured conditions will meet your requirements
2. Create a policy and define the following:Policy name
Check conditionCheck condition
If enabled
Execution mode
Server restrictions
Category
DescriptionDescription
Optional help hyperlink
![Page 22: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/22.jpg)
How to Apply Policies
• Manually run policies that are configured with the On demand deployment mode to apply the policy
• Configure policies to be applied automatically:Configure policies to be applied automatically:
Set the deployment mode to On schedule, On change: log only, or On change: prevent
bl h lEnable the policy
Verify that the target belongs to the target set that is defined in the policy
Verify subscription to the policy
![Page 23: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/23.jpg)
How to Evaluate PoliciesE l t P li i M ll R P li iEvaluate Policies Manually Run Policies
Results appear in the Evaluate
Policies window
![Page 24: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/24.jpg)
How to Assign Policies
Apply all policies in a category to all databases by using the Mandate Database Subscriptions setting
Mandate Database Mandate Database
SubscriptionsSubscriptions
1. Clear the Mandate Database Subscriptionssetting
2. Use the Categories option on the Policies menu of the appropriate object, and then select the
Assign Policies to Individual
Assign Policies to Individual
Subscribed check box for the appropriate category
Individual Objects
Individual Objects
![Page 25: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/25.jpg)
SQL Server 2008 Performance Enhancements
• Managing Workloads by Using Resource Governor
• Monitoring Performance by Using Data Collector
• Managing Performance by Using Plan Freezing
![Page 26: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/26.jpg)
Managing Workloads by Using Resource Governor
• What Is Resource Governor?
• What Are Resource Pools and Workload Groups?
• How to Manage Resource Governor
• How to Assign a Workload to a Workload Group
![Page 27: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/27.jpg)
What Is Resource Governor?
• Resource Governor is a tool to define limits and assign priorities to individual workloads that are running on a SQL Server instance:
Workloads are based on factors such as users, applications, and databases
Limits control the resources that are available to specific pworkloads:
Minimizes the effects of runaway queries
Priorities can optimize the performance of a mission critical Priorities can optimize the performance of a mission-critical process while maintaining predictability for the other workloads on the server
![Page 28: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/28.jpg)
What Are Resource Pools and Workload Groups?
• Resource pools:
Can contain many workload groups
Li it t Limit system resources
• Workload groups:
Are assigned to resource poolsAre assigned to resource pools
Group applications and limit resources that are specific to SQL Server
![Page 29: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/29.jpg)
How to Manage Resource Governor
1. Enable Resource Governor
2. Configure resource pools
3. Configure workload groups
4. Create a classification function to assign workloads to workload groupsworkload groups
![Page 30: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/30.jpg)
How to Assign a Workload to a Workload Group
• Create a classifier function
CREATE FUNCTION dbo fn ClassifyApps() RETURNS sysnameCREATE FUNCTION dbo.fn_ClassifyApps() RETURNS sysnameWITH SCHEMABINDINGASBEGIN
C @DECLARE @ret sysnameIF (APP_NAME() LIKE '%Low Importance Application%') SET @ret='Low Importance Group'RETURN @retRETURN @ret
ENDGOALTER RESOURCE GOVERNOR
WITH (CLASSIFIER FUNCTION db f Cl if A )WITH (CLASSIFIER_FUNCTION = dbo.fn_ClassifyApps)ALTER RESOURCE GOVERNOR RECONFIGURE
![Page 31: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/31.jpg)
Monitoring Performance by Using Data Collector
• What Is Data Collector?
• Data Collection Architecture
• How to Configure a Management Data Warehouse
• How to Manage Data Collection
• How to View Performance Data
![Page 32: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/32.jpg)
What Is Data Collector?
• It is a set of tools to collect performance information
• It provides an API that enables client applications to access performance dataaccess performance data
• It includes SQL Server Agent jobs and SSIS packages that provide data to the API
• It provides a management data warehouse that stores historical performance data
![Page 33: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/33.jpg)
Data Collection ArchitectureClient
• SQL Server Agent schedules the Data Collector run-time component
SQL Server Management Studio
Console interface
Reports
APIcomponent
• The Data Collector run-time component executes the Data Collector SSIS
Data Collector API
Classlibrary
Stored proceduresAnd viewsthe Data Collector SSIS
packages
• The SSIS packages collect h d f h d
library And views
DataCollector SQL
Execution
the data from the data providers and upload it to the management data warehouse
SSISCollectorRun-time
component
ServerAgent
warehouseData collectionconfiguration
SSIS packages
Audit and history
J b d fi iti
Storage
Jobs definition
![Page 34: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/34.jpg)
How to Configure a Management Data Warehouse
• Use the Configure Management Data Warehouse Wizard to:
Specify a database to store collected data and specify a folder p y p ylocation for temporary storage before upload
Specify user and group access to the management data warehouse
![Page 35: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/35.jpg)
How to Manage Data Collection
•Configure the three System Data collection sets:
Disk Usageg
Query Statistics
Server Activity
•You can specify:
Upload schedule
Collection frequency
Security
R t ti i dRetention period
•You can view:
Input parameters to define Input parameters to define the Transact-SQL used to gather the data
![Page 36: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/36.jpg)
How to View Performance Data
• To view reports, right-click Data Collection, point to Reports, and then click one of the available options:
Some reports have links to more specific informationp p
![Page 37: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/37.jpg)
Managing Performance by Using Plan Freezing
• What Is Plan Freezing?
• Scenarios for Plan Freezing
• How to Create a Plan Guide
• How to Enable and Disable a Plan Guide
• How to Copy a Plan Guide
![Page 38: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/38.jpg)
What Is Plan Freezing?
• Plan freezing creates a plan guide that:
Contains hints or a full query plan
I tt h d t ifi T t SQL t t tIs attached to a specific Transact-SQL statement
Can be enabled or disabled
Can be copied between serversCan be copied between servers
exec sp_create_plan_guide_from_handle@name = N'CustomerSales',@plan_handle = @plan_handle,@statement start offset @offset@statement_start_offset = @offset
![Page 39: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/39.jpg)
Scenarios for Plan Freezing
• SQL Server upgrade:
Query plans are often updated during migration
M t d t b fi i lMost updates are beneficial
Plan guides enable you to roll back detrimental query plan updates
• Prevent query regression:
You can create plan guides and then disable them to enable queries to benefit from statistics-based recompilesqueries to benefit from statistics based recompiles
If the query regresses, you can enable the plan guide to revert to the previous query plan
• Copy plan guides:
You can script plan guides on test servers and then apply them to production servers
Enable thorough testing of plan guides before deployment
![Page 40: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/40.jpg)
How to Create a Plan Guide
1. Execute DBCC FREEPROCCACHE to clear the query cache
2. Execute queries for which you want to create a plan 2. Execute queries for which you want to create a plan guide
3. Execute sp_create_plan_guide_from_handle to create plan guides for the specific query or for every create plan guides for the specific query or for every query in the cache
![Page 41: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/41.jpg)
How to Enable and Disable a Plan Guide
• To enable a plan guide:
New plan guides are enabled by default
T di bl l id
EXEC sp_control_plan_guide N'ENABLE', N'CustomerSales'
• To disable a plan guide:
EXEC sp_control_plan_guide N'DISABLE', N'C S l 'N'CustomerSales'
![Page 42: UPDATING YOUR SQL SERVER 2005 SKILLS TO SQL SERVER 2008download.microsoft.com/download/9/a/1/9a1bd19d-f612-4444... · 2018-10-16 · SQL Server Version History SQL Server 1.0 (1989)](https://reader035.fdocuments.us/reader035/viewer/2022062303/5f7b1a6fb295a575ca16cf82/html5/thumbnails/42.jpg)
How to Copy a Plan Guide
1. Script plan guide in SQL Server Management Studio on source server:
Plan guides are also included in complete database scriptsg p p
2. Execute script on destination server