Managing the software Module 11 8/29/2018 9:32 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Module Agenda Software management and patch releases Database upgrade 8/29/2018 9:32 PM Module Agenda Software management and patch releases Database upgrade Uninstalling the software © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Lesson 1 Software management and patch releases
Microsoft update policy overview 8/29/2018 9:32 PM Microsoft update policy overview Security updates Mainstream support Extended support Microsoft provides security updates for a minimum of 10 years (through the Extended Support phase) Mainstream support (first five years since the official release date of a SQL Server version) covers also non-security updates and requests to change product design and features In the Extended Support phase non-security related updates are available through Premier Support https://support.microsoft.com/en-us/lifecycle#gp/lifePolicy Source: “Microsoft Support Lifecycle” - https://support.microsoft.com/en-us/lifecycle#gp/lifePolicy Microsoft provides all service packs and cumulative updates to all customers – no support contract needed. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Determine SQL Server version 8/29/2018 9:32 PM Determine SQL Server version -- Programmatic way SELECT SERVERPROPERTY('productversion') , SERVERPROPERTY ('productlevel') , SERVERPROPERTY ('edition'); -- General way SELECT @@version; Programmatic way works with: SQL Server 2014 RTM CU10 and later versions SQL Server 2014 Service Pack 1 CU3 and later versions SQL Server 2012 Service Pack 2 CU7 and later versions Source from “How to determine the version, edition and update level of SQL Server and its components ” - https://support.microsoft.com/en-us/kb/321185 Note A downloadable version of Excel Workbook with all the build versions together with their current support life cycle stage for 2005 through the current version is available, click to download this Excel now - http://download.microsoft.com/download/7/C/1/7C1BA242-14B5-48AE-9A99- 7CE4FE9DAAF9/SQL%20Server%20Builds%20V3.xlsx © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Where to go for updates? SQL Server setup integrates the latest product updates with the main product installation so that the main product and its applicable updates are installed at the same time. The SQL Server updates are available through Microsoft Update (MU), Windows Server Update Services (WSUS) and the Microsoft Download Center. Security and Critical updates for SQL Server are available through Microsoft Update, and to be able to see these updates you need to opt-into MU through the Windows Update applet in Control panel. You can manually install service packs and cumulative updates through the Update Center fir Microsoft SQL Server at https://technet.microsoft.com/en-us/sqlserver/ff803383.aspx
Servicing installation overview 8/29/2018 9:32 PM Servicing installation overview Prepare for a SQL Server update installation Install SQL Server updates Restart services and applications Backup SQL server system databases (master, msdb, model) Back up your Analysis Services databases, configuration file, and repository Verify that the system databases have sufficient free space Stop Services and Applications To install a SQL Server 2016 update, run the self-extracting package file. Cumulative update package (CU): <SQLServer2014>-KBxxxxxx-PPP.exe Service pack package (PCU): <SQLServer2014><SPx> -KBxxxxxx-PPP-LLL.exe x indicated service pack number PPP indicates the specific platform. LLL indicates the character abbreviation for the SQL Server language, for example: LLL for English is ENU. If prompted to restart computer, make sure the services you stopped before applying the updates are restarted Restart the applications you closed before running the update setup Consider another backup of the system databases after a successful upgrade Source: “Overview of SQL Server Servicing Installation” - https://msdn.microsoft.com/en- us/library/dd638062.aspx © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Automatic patching of SQL Server IAAS on Azure 8/29/2018 9:32 PM Automatic patching of SQL Server IAAS on Azure Automated Patching establishes a maintenance window for an Azure Virtual Machine running SQL Server 2012 or 2014 Automated Updates can only be installed during this maintenance window Resource from “Automated Patching for SQL Server in Azure Virtual Machines” - https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-classic-ps-sql-patch/ © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Considerations for high availability systems 8/29/2018 9:32 PM Considerations for high availability systems A rolling upgrade is required in SQL Server solution environments involving multiple SQL Server instances that must be upgraded in a certain order to maximize uptime, minimize risk, and preserve functionality. See the following resources for information: Always-On Availability Groups - https://msdn.microsoft.com/en-us/library/dn178483.aspx Failover clustering instances - https://msdn.microsoft.com/en-us/library/ms191009.aspx Mirrored instances - https://msdn.microsoft.com/en-us/library/bb677181.aspx Log shipping instances - https://msdn.microsoft.com/en-us/library/cc645954.aspx Replication environment - https://msdn.microsoft.com/en-us/library/ms143699.aspx SQL Server Reporting Services scale-out environment - https://msdn.microsoft.com/en-us/library/ms143747.aspx Resource: “Choose a Database Engine Upgrade Method” - https://msdn.microsoft.com/en- us/library/mt551979.aspx © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Resources Overview of SQL Server Servicing Installation Install SQL Server 2016 Servicing Updates Update Center for Microsoft SQL Server Patching SQL Server Failover Cluster Instances with Cluster-Aware Updating (CAU)
Lesson 2 Database upgrade 8/29/2018 9:32 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Typical upgrade concerns Deprecated SQL Server features Discontinued SQL Server features Breaking changes
Deprecated SQL Server features Server & Tools Business 8/29/2018 Deprecated SQL Server features 2008 SOAP/HTTP endpoints 2014 Backup and restore with password Database compatibility level 90 Return result sets from triggers Remote servers SET ROWCOUNT for INSERT, UPDATE, and DELETE Sqlmaint utility Deprecated in 2008 - http://msdn.microsoft.com/en-us/library/cc707789(v=sql.100).aspx © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Discontinued features Server & Tools Business 8/29/2018 Discontinued features 2008 SQL-DMO Web assistant Changes to command line setup Groups Dump and load commands Sp_addalias 2008 R2 64-bit platform support in Reporting Services 2012 Active Directory helper services Backup and restore with database SQLMail COMPUTE / COMPUTE BY Use of *= and =* join types RAISEERROR integer “string” format FASTFIRSTROW hint sp_dboption SQL Server 2008 Discontinued features - http://msdn.microsoft.com/en-us/library/cc707782(v=sql.100).aspx 2008 R2 - http://msdn.microsoft.com/en-us/library/cc707782(v=sql.105).aspx 2012 - http://msdn.microsoft.com/en-us/library/cc707782(v=sql.110).aspx 2014 - http://msdn.microsoft.com/en-us/library/ms144262(v=sql.120).aspx © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Server & Tools Business 8/29/2018 Breaking changes 2008 SMO reversioned Native client 10.0 behavior changes Use of custom CLR functions with impersonation Error codes for login failures Permissions management No subqueries in GROUP BY OUTPUT clause Sp_helpuser group - > ole TOP clause in Views 2008 R2 New installation parameter for unattended installations 2012 Xevent changes with resource_monitor_ring_buffer_ record and memory_node_oom_ ring_buffer_recorded Sync framework no longer in standard install T-SQL: Select NEXT VALUE, PIVOT in CTE, WITHIN keyword, ALTER TABLE changes, rowcount returned for DML is 0 not -1 DMV field changes Catalog view changes SQL CLR data type changes http://msdn.microsoft.com/en-us/library/ms143179.aspx © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Identifying deprecated features 8/29/2018 9:32 PM Identifying deprecated features Extended Events for > 2005 SQL Server Profile for < 2005 Resources: https://www.mssqltips.com/sqlservertip/1857/identify-deprecated-sql-server-code-with-extended- events/ © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
SQL Server 2016 Upgrade Advisor Unifying the experience for upgrades and migrations Feature compatibility analysis Feature recommendations Auto-fix compatibility issues Schema and data migration Identification, recommendation and prioritization of compatibility issues Feature-specific recommendations such as security, performance, storage based on schema, data, and workloads Automatic resolution of compatibility issues One-time or continuous schema and data synchronization
SQL Server 2016 Upgrade Advisor Sources and targets SQL Server 2008/R2 SQL Server 2012 SQL Server 2012 SQL Server 2014 SQL Server 2016 Azure SQL Database Azure SQL Data Warehouse
Using the SQL Server Upgrade Advisor Review Hardware and Software Requirements for Installing SQL Server 2016. Back up data. Run Upgrade Advisor. Upgrade Advisor does not modify your data or change settings on your computer. Review the issues identified in the Upgrade Advisor report. Resolve any blocking issues that would prevent you from upgrading to SQL Server 2016. Run Upgrade Advisor to verify that all known issues have been addressed. Upgrade Resolve any post-upgrade and migration issues.
Demo Upgrading SQL Server 2005 databases
Demo Clustered Columnstore Advisor
SQL Server 2016 Upgrade Advisor Feature recommendations Now Planned In-Memory Columnstore In-Memory OLTP Stretch Database Always Encrypted Dynamic Data Masking Reporting Services Integration Services Analysis Services
Upgrade Paths Two Main Choices Considerations Upgrade “in-place” 8/29/2018 9:32 PM Upgrade Paths Two Main Choices Upgrade “in-place” Side-by-Side Migration Considerations Version / Edition Scope of Upgrade Downtime Coordination/Length Other “Stuff” – Jobs, Logins, connection strings, etc Disk space Many more! See the Upgrade white paper in resources Resource: “Choose a Database Engine Upgrade Method” - https://msdn.microsoft.com/en- us/library/mt551979.aspx There are several approaches to consider when you are planning to upgrade the Database Engine from a prior release of SQL Server to SQL Server 2016 in order to minimize downtime and risk. You can perform an upgrade in-place, migrate to a new installation, or perform a rolling upgrade. The following diagram will help you to choose amongst these approaches. Each of the approaches in the diagram are also discussed below. To assist you with the decision points in the diagram, please also review Plan and Test the Database Engine Upgrade Plan - https://msdn.microsoft.com/en-us/library/mt519723.aspx. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Typical Factors for Classifying the Database for Upgrades Is it a 3rd Party Vendor App? Is the DB considered to be Mission Critical? Is HADR Required? Is it considered to be a large database? Is the amount of ad hoc SQL (from Client) significant? How long will a failback take?
Upgrade Plan (Sample) Pre-Upgrade Upgrade Advisor (Database and Trace) Script Jobs / Logins FREEZE any new logins/jobs Run Scripts to create Jobs/Logins in new environment Disable Jobs in New Environment
Upgrade Plan (Sample) Transition (Downtime) Modify DNS or client connection strings Pause SQL Server Checkpoint FULL Backup Copy to New Environment DBCC CheckDB in Current Environment Restore DB in New Environment Set Compatibility Level to 100 Redirect DNS or client connection strings
Upgrade Plan (Sample) Post-Upgrade Enable Jobs in New Environment Disable Jobs in Old Environment Take the old database offline Create Maintenance Plan for Index Rebuild DBCC CHECKDB in new environment Communicate to operations to create backup jobs
Using Query Store to after upgrade 8/29/2018 9:32 PM Using Query Store to after upgrade Upgrade to SQL 2016 Keep 110/120 CompatLevel Freeze plans (optional) Run Query Store (establish perf. baseline) Move to 130 CompatLevel and unfreeze plans Monitor perf. and fix regressions with plan forcing Source: https://msdn.microsoft.com/en-us/library/dn817826(v=sql.130).aspx#Stability Maintaining Query Performance Stability For queries that are executed multiple times you may notice that SQL Server used different plans which resulted in different resource utilization and duration. With Query Store you can easily detect when the query performance regressed and determine the optimal plan within a period of interest. Then you can force that optimal plan for future query execution. You can also identify inconsistent query performance for a query with parameters (either auto- parameterized or manually parameterized). Among different plans you can identify plan which is fast and optimal enough for all or most of the parameter values and force that plan; keeping predictable performance for the wider set of user scenarios. Force or a plan for a query (apply forcing policy). When a plan is forced for a certain query, every time a query comes to execution it will be executed with the plan that is forced. EXEC sp_query_store_force_plan @query_id = 48, @plan_id = 49; When using sp_query_store_force_plan you can only force plans that were recorded by Query Store as a plan for that query. In other words, the only plans available for a query are those that were already used to execute Q1 while Query Store was active. Remove plan forcing for a query. To rely again on the SQL Server query optimizer to calculate the optimal query plan, use sp_query_store_unforce_plan to unforce the plan that was selected for the query. EXEC sp_query_store_unforce_plan @query_id = 48, @plan_id = 49; Other notes: De-risk upgrades: QDS PF and COMPAT LEVEL All plans are freezed in pre-upgrade state We changed QP to keep CE changes under compat level © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Resources Upgrade to SQL Server 2016 Choose a Database Engine Upgrade Method Plan and Test the Database Engine Upgrade Plan Complete the Database Engine Upgrade SQL Server 2014 Upgrade Technical Guide SQL Server 2005 End of Support site Download SQL Server 2016 Upgrade Advisor
Lesson 3 Uninstalling the software
Uninstalling SQL Server 8/29/2018 9:32 PM Uninstalling SQL Server Before you uninstall Install SQL Server updates Removing other services Backup your data or copy to another folder than the MSSQL directory. Delete the local security groups Stop all SQL Server services Login to the account on server that has appropriate permissions to uninstall From Control Panel – Programs and Features, select Microsoft SQL Server 2016 and clock Uninstall to launch the SQL Server Installation Wizard Use the wizard to uninstall each instance you want to remove Refer to the instructions for these components: Uninstall Power Pivot for SharePoint Uninstall Reporting Services Uninstall and Remove Master Data Services Remove Data Quality Server Objects Source: “Overview of SQL Server Servicing Installation” - https://msdn.microsoft.com/en- us/library/dd638062.aspx © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Resources Uninstall SQL Server 2016
Lesson summary Software management and patch releases Database upgrade 8/29/2018 9:32 PM Lesson summary Software management and patch releases Database upgrade Uninstalling the software © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
8/29/2018 9:32 PM © 2016 Microsoft Corporation. All rights reserved. Microsoft, SQL Server, Windows, 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. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.