Sneak Peek: Migrating to SQL Server 2017 - Presenting Sponsor - PASS.org

Page created by Jeffrey Dawson
 
CONTINUE READING
Sneak Peek: Migrating to SQL Server 2017 - Presenting Sponsor - PASS.org
Sneak Peek: Migrating to
SQL Server 2017

Glenn Berry, Principal Consultant, SQLskills.com

                                                   Presenting Sponsor
Sneak Peek: Migrating to SQL Server 2017 - Presenting Sponsor - PASS.org
Technical Assistance

If you require assistance    Maximize your screen with   Please fill in the short
during the session, type     the zoom button on the      evaluation following the
your inquiry into the        top of the presentation     session. It will appear in
question pane on the right   window.                     your web browser.
side.
Sneak Peek: Migrating to SQL Server 2017 - Presenting Sponsor - PASS.org
Thank you to our Presenting Sponsor

Quest helps IT Professionals simplify administration tasks so they can
 focus on the evolving needs of their businesses. Combined with its
  commitment to help companies protect today’s investment while
    planning for the future, Quest continues to deliver the most
 comprehensive solutions to monitor, manage, protect and replicate
                      database environments.
Sneak Peek: Migrating to SQL Server 2017 - Presenting Sponsor - PASS.org
Explore
everything
PASS has
to offer
                          Description here     Local user groups    Free 1-day local
                                               around the world      training events

Free Online Resources
Newsletters
PASS.org

                           Online special      Business analytics    Get involved
                        interest user groups        training
Author
                                      Numerous books, articles, and blog posts.
                                      Blog: https://www.sqlskills.com/blogs/Glenn
                                      Articles: https://bit.ly/2i7YdYY

                                      Course author/instructor

Glenn Berry                           Thirteen SQL Server related courses on
                                      Pluralsight https://bit.ly/2hbg5SW

Principal Consultant, SQLskills.com
                                      Beer brewer
   •   /glberry
                                      I do all-grain beer brewing with a stainless
                                      steel, three vessel system
   •   @GlennAlanBerry

   •   glenn.berry.92

   •   glenn@sqlskills.com
Sneak Peek: Migrating to SQL
Server 2017

Glenn Berry, Principal Consultant, SQLskills.com

                                                   Presenting Sponsor
I Know How to Brew Beer…
Some Examples…
Agenda
•   Making the case for an upgrade
•   Upgrade planning
•   Hardware and storage considerations
•   Migration methods
•   Post migration tasks
Reasons to Upgrade to SQL Server 2017
• Many useful new features not available in older versions
• New features in Standard Edition (new in SQL Server 2016 SP1)
• Higher hardware license limits for Standard Edition(vs. SQL 2012, 2014)
• Leverage new hardware and storage options
• Legacy version may be out of Mainstream and/or Extended support
• Better manageability support than older versions
• Better GDPR support than legacy versions
• Keeps your technical staff happier!
Making the Case for an Upgrade
• Is your version of SQL Server still supported by Microsoft?
   • What are the Mainstream and Extended support end dates?
   • Can you purchase Premium Assurance? (https://bit.ly/2nl4rqd)

• Is your version of the operating system still supported by Microsoft?
   • What are the Mainstream and Extended support end dates?
   • Are you on the Semi-Annual Channel or the Long-Term Servicing Channel?

• Is your hardware or storage out of warranty?
   • Even if it is not out of warranty, is it just slow?
   • You may be surprised what new hardware and storage is capable of!
SQL Server Support End Dates
SQL Server Version            Mainstream Support   Extended Support

SQL Server 2005               April 12, 2011       April 12, 2016

SQL Server 2008 and 2008 R2   July 8, 2014         July 9, 2019

SQL Server 2012               July 11, 2017        July 12, 2022

SQL Server 2014               July 9, 2019         July 9, 2024

SQL Server 2016               July 13, 2021        July 14, 2026

SQL Server 2017               October 11, 2022     October 12, 2027
Windows Server Support End Dates
Windows Server Version            Mainstream Support   Extended Support

Windows Server 2003 and 2003 R2   July 13, 2010        July 14, 2015

Windows Server 2008 and 2008 R2   January 13, 2015     January 14, 2020

Windows Server 2012 and 2012 R2   October 9, 2018      October 10, 2023

Windows Server 2016               January 11, 2022     January 11, 2027

Windows Server, version 1709      April 18, 2019       Not Available
What’s New in SQL Server 2016 and 2017
• SQL Server 2016: It just runs faster
      • https://bit.ly/1UhNfwp
• SQL Server 2016 SP1: Know your limits
      • https://bit.ly/2zPqmey
• Query Optimizer Additions in SQL Server 2016
      • https://bit.ly/1XUE6wM
• Experience SQL Server 2017: Start your journey here
      • https://bit.ly/2yTZxZk
• SQL Server Automatic Tuning around the world…
      • https://bit.ly/2JNJnXo
Persisted Log Buffer Feature
• New feature in SQL Server 2016 Service Pack 1
      • Uses NVDIMM persistent memory for a second, 20MB transaction log file
• Requires a direct access (DAX) volume on an NVDIMM device
      • Storage class memory mapped to a DAX volume
• Persisted Log Buffer limitations
      •   Does not work with TDE or on an AG Primary
      •   Does work on AG Secondary
      •   Does not work with virtualization
      •   Exception: Hyper-V on Windows Server, version 1709 or newer
      •   Exception: Hyper-V on Windows Server 2019
Enterprise Edition vs. Standard Edition
• Useful feature differences
   •   Online index operations
   •   Resource Governor
   •   Transparent Database Encryption (TDE)
   •   Full availability group support
   •   Online page and file restore
• Editions and supported features of SQL Server 2017
       • http://bit.ly/2hkJKse
• Reasons to Upgrade to SQL Server 2017
       • https://bit.ly/2JsyqHa
Enterprise Edition vs. Standard Edition
• Key performance differences
  •   Enterprise uses parallelism for many tasks
  •   Enterprise provides better storage performance
  •   Enterprise uses columnstore indexes and In-Memory OLTP without limits
  •   Enterprise uses aggregate pushdown and local aggregates for columnstore
  •   Enterprise uses processor hardware support for some columnstore operations
• SQL Server Enterprise Edition Performance Advantages
             • https://bit.ly/2nB0E8d
SQL Server 2017 Licensing Costs
  Edition                  Server License            Core License

  Standard                       $931.00             $1,859.00

  Enterprise                Not Available            $7,128.00

• Minimum of four core licenses per physical processor
• Minimum of four core licenses per virtual machine
• Server licenses require Client Access Licenses (CALs)
   • CALs are $209.00 each
   • Each user/device must have a CAL to access any SQL Server
   • Once they have a CAL, they can access any SQL Server
SQL Server 2017 License Limits
• Enterprise Edition
   • Operating system maximum for memory
         •   24TB on Windows Server 2016, 4TB on Windows Server 2012 R2
   • Operating system maximum for sockets and physical cores

• Standard Edition
   • 128GB of RAM for Database Engine (per instance)
         •   32GB for In-Memory OLTP (per DB), 32GB for Columnstore (per instance)
   • Limited to lesser of 4 sockets or 24 physical cores (non-virtualized)
   • Limited to lesser of 4 sockets or 24 virtual cores (virtualized)
   • No change from SQL Server 2016 SP1 limits
Windows Server 2016 Licensing Changes
• Windows Server 2016 uses core-based licensing
  • Requires minimum of 8 core licenses/processor or 16 core licenses/server
  • This may cause confusion and conflicts with your server administrators!
  • They may want to have at least eight physical cores/processor

• Two main editions of Windows Server 2016
  •   Standard Edition and Datacenter Edition
  •   Non-virtualization hosts can use Standard Edition
  •   Storage Spaces Direct requires Datacenter Edition (for S2D nodes)
  •   Pricing for sixteen core licenses
        •   Standard Edition:    $882.00
        •   Datacenter Edition: $6,555.00
SQL Server and Hardware Selection
• Nobody will ever complain that a database server is too fast!
   • You will be blamed for poor performance and have to deal with it

• New server hardware is very affordable compared to SQL Server licenses
   • Don’t reuse old database hardware for a new version of SQL Server

• Be aware of SQL Server hardware licensing limits
   • They are different for different versions and editions of SQL Server

• Don’t be afraid to point out the age and performance of your hardware
   • Your organization may not be aware of existing hardware performance issues
Intel Server Processor Family Tree
Year   Process   Model Families                       Code Names

2006   65nm      Xeon 3000, 3200, 5100, 7300          Woodcrest, Clovertown

2007   45nm      Xeon 3100, 3300, 5400, 7400          Wolfdale, Harpertown

2008   45nm      Xeon 3400, 3500, 5500, 7500          Nehalem-EP, Nehalem-EX (2010)

2010   32nm      Xeon 3600, 5600, E7-4800             Westmere-EP, Westmere-EX (2011)

2011   32nm      Xeon E3-1200, E5-2600                Sandy Bridge, Sandy Bridge-EP (2012)

2012   22nm      Xeon E5-2600 v2, E7-4800 v2          Ivy Bridge-EP, Ivy Bridge-EX (2013)

2014   22nm      Xeon E5-2600 v3, E7-4800 v3          Haswell-EP, Haswell-EX (Q2 2015)

2016   14nm      Xeon E5-2600 v4, E7-8800 v4          Broadwell-EP, Broadwell-EX (Q4 2016)

2017   14nm      Xeon Platinum 8000, Gold 6000/5000   Skylake-SP (Q3 2017)

2018   14nm      Xeon ??                              Cascade Lake-SP (2H 2018)
Intel Xeon Major Generational Differences
• Intel Xeon Processor E5-2600 Product Family Technical Overview
   • https://intel.ly/2wOgLXa
• Intel Xeon Processor E5-2600 V2 Product Family Technical Overview
   • https://intel.ly/2vwPhRn
• Intel Xeon Processor E5-2600 V3 Product Family Technical Overview
   • https://intel.ly/2cXPciz
• Intel Xeon Processor E5-2600 V4 Product Family Technical Overview
   • https://intel.ly/2dUCXEU
• Intel Xeon Processor Scalable Family Technical Overview
   • https://intel.ly/2wFnTpp
How Do You Select the Exact Processor?
• One method is to use actual TPC-E benchmark scores
  •   Find the best actual score for a given processor family (flagship score)
  •   Server vendors only make submissions for the flagship processor
  •   Adjust the actual score for core count and base clock speed differences
  •   Calculate the estimated total score and estimates score/core

• What these scores mean
  • Total score measures CPU capacity of the system
  • Score/core measures single-threaded performance of that processor
  • These numbers are very useful for sizing calculations for upgrades, consolidation,
    and virtualization
Comparative Skylake-SP 2P System Metrics
Model           Raw TPC-E Score   Total Cores   Score/Core   License Cost

Platinum 8180   6,598.36          56            117.83       $399,168.00

Platinum 8170   5,146.72          52            98.98        $370,656.00

Platinum 8168   6,108.20          48            127.25       $342,144.00

Gold 6154       5,090.16          36            141.39       $256,608.00

Gold 6142       3,921.31          32            122.54       $228,096.00

Gold 6132       3,431.15          28            122.54       $199,584.00

Gold 6146       3,619.67          24            150.81       $171,072.00

Gold 6144       2,629.34          16            164.33       $114,048.00

Gold 6128       1,922.95          12            160.17       $ 85,536.00

Gold 5122       1,357.38           8            169.63       $ 57,024.00
Comparative Broadwell-EP 2P System Metrics
 Model         Raw TPC-E Score   Total Cores   Score/Core   License Cost

 E5-2699A v4   5,387.06          44            122.44       $313,632.00

 E5-2698 v4    4,489.22          40            112.24       $285,120.00

 E5-2697 v4    4,223.95          36            117.34       $256,608.00

 E5-2697A v4   4,234.35          32            132.64       $228,096.00

 E5-2690 v4    3,713.81          28            132.64       $199,584.00

 E5-2687W v4   3,673.00          24            153.04       $171,072.00

 E5-2640 v4    2,448.66          20            122.43       $142,560.00

 E5-2667 v4    2,611.91          16            163.24       $114,048.00

 E5-2643 v4    2,081.36          12            173.44       $ 85,536.00

 E5-2637 v4    1,428.39           8            178.54       $ 57,024.00
Bad CPU Choice vs. Good CPU Choice
  Processor Choice         TPC-E Score   Score/Physical Core   SQL 2017 EE License Cost

  (2) Xeon Bronze 3106       641.80       40.11                $114,048.00

  (1) Xeon Gold 6144        1,321.35     165.16                $ 57,024.00

• Two-socket server
  • Bad choice has two, Xeon Bronze 3106 eight-core processors
      •    https://intel.ly/2EzIHlF
  • Good choice has one, Xeon Gold 6144 eight-core processor
      •    https://intel.ly/2JKKYxa
Flash Storage Interfaces and Protocols
• The interface and protocol have a huge effect on performance
• SAS/SATA interface and Advanced Host Controller Interface (AHCI) protocol
      • Legacy interface and protocol
      • SAS/SATA: 3Gbps, 6Gbps, 12Gbps (275MB/sec, 550MB/sec, and 1100MB/sec)
      • AHCI protocol limited to one command queue and 32 commands per queue
• PCI Express (PCIe) interface
      • Uses PCIe slot on motherboard for lower latency and higher throughput
      • Other form factors (such as Ruler PCIe 3.1) are available
      • Currently PCIe 3.0, but 4.0 and 5.0 are coming in the next 12-24 months
• Non-Volatile Memory Express (NVMe) protocol
      • Much lower latency and CPU utilization than legacy AHCI protocol
Hardware Review
• Processor selection is critically important
      • It drives most other hardware and storage choices
      • It directly affects performance, scalability and licensing costs
• Modern Intel processors are usually the best choice
      • Better single-threaded performance and lower licensing costs
      • AMD EPYC 7000 series may be a better choice for some workloads
• Consider your workload type as you choose your hardware
      • Different workload types benefit from specific hardware choices
• Be aware of what edition of SQL Server 2017 you will be using
      • This affects your hardware choices due to license limits
Migration Planning
• Avoiding data loss during the migration
   • What migration method should you use?
• Minimizing downtime during the migration
   • What are the business requirements?
• Reducing infrastructure impact during migration
   • Proper planning and preparation work is very valuable
• Avoiding performance regressions after migration
   • You don’t want to be unpleasantly surprised!
   • Performance regressions are common when you don’t test properly
Preparing Legacy Databases for Migration
• Objective is to reduce the size of the databases for easier migration
   • Delete unused objects such as scratch tables
   • Try to get authorization from business to archive or delete old data
   • Eliminate unused and duplicate indexes, and reduce index fragmentation
• Consider shrinking data file(s) under right circumstances
   • Make sure to do index maintenance to eliminate fragmentation afterwards
• Reduce VLF counts and shrink transaction log file
   • Eliminate extra transaction log files, if you have any
• Run DBCC CHECKDB before migration
   • Correct any issues that you find
Production Migration Methods
• Backup/restore of databases
• Microsoft Database Migration Assistant
• Log shipping
• Database mirroring
• Post migration tasks
Backup/Restore Databases
• This is the safest method for migration
   • Far less risk than attach/detach method
• May require long outage due to database size and infrastructure limits
   • Downtime related to backup/restore performance
   • Leverage full, differential, and multiple log backups to reduce downtime
• Prepare legacy databases to reduce backup/restore times
   • Cleanup unneeded data, reduce index fragmentation, etc.
   • Shrink transaction log before full backup to reduce VLF count and reduce time
     needed for zeroing out log file during full restore operation
Microsoft Data Migration Assistant
• Replaced Database Upgrade Advisor for SQL Server 2016
• DMA helps you upgrade to a newer version of SQL Server or to Azure SQL
  Database by detecting upgrade compatibility issues
     • Breaking changes, behavior changes, and deprecated features
• DMA also recommends new features based on your database schema
     • Heavily biased towards Azure SQL Database features
  DMA can also be used to move schema, data, and uncontained objects
     • Can migrate multiple databases in a single batch
Using Log Shipping for Migration
• Log shipping is easy to configure and use
   • Does not require servers to be in same domain
   • Does not require certificates or endpoints
   • Does not put any extra load on legacy instance
• Relatively short downtime for bringing databases online on new instance
   •   Final log backups on old instance
   •   Copy log backup files to new instance
   •   Restore final log backups on new instance
   •   Restore each database WITH RECOVERY on new instance
   •   Point all applications at new instance
   •   T-SQL scripts can semi-automate most of this
Using Database Mirroring for Migration
• Database mirroring is more complicated to set up than log shipping
   • You don’t need or want a Witness instance for migration
• You create the mirrored copy of your databases in advance
   • Users/applications are not aware of your preparation work
• Requires mirroring TCP endpoints and firewall access for them
• Much easier if servers are in the same domain
   • Otherwise, you can use certificates
• Adds some extra load on legacy instance
• Very short downtime to failover each mirrored database to new instance
   • Property change for each database and then process REDO queue
   • T-SQL scripts can semi-automate this step
Persisting the Statistics Sampling Rate
• SQL Server 2016 SP1 CU4 introduced new statistics option
   • PERSIST_SAMPLE_PERCENT = ON (https://bit.ly/2vpmseF)
   • Added in SQL Server 2017 CU1
• Available with CREATE STATISTICS and UPDATE STATISTICS
   • If you create new statistics or manually update existing statistics, you can use this
     new option to force SQL Server to use the previous sample rate
   • Applies to auto update statistics
   • Applies to manual UPDATE STATISTICS that does not set the sampling rate
• This is a nice enhancement that you should take advantage of
   • https://bit.ly/2iFWYnj
Post-Migration Tasks
• There are several tasks you need to complete after the migration
   • Full database backup of all user and system databases
   • Run DBCC CHECKDB on all user and system databases
   • Update statistics on all user databases
        •   Run sp_updatestats first, then UPDATE STATISTICS WITH FULLSCAN later
        •   Rebuild indexes as you have time
  • Enable Query Store on user databases
        •   Start collecting performance baselines
  • Change compatibility level on user databases
        •   Look for any performance regressions
  • Enable automatic plan choice correction (new in SQL Server 2017)
        •   https://bit.ly/2rdTpE8
  • Monitor instance health and performance
Questions?
Coming up next…
Why Performance Tuning Wisdom Needs Expiration Dates

Brent Ozar and Erick Darling
Thank you for attending
Learn more from Glenn Berry
  @GlennAlanBerry   glenn@sqlskills.com

                                          @sqlpass
                                          #sqlpass

                                          @PASScommunity
Presenting Sponsor
You can also read