Best practices are recommendations for a rock solid system and high performance. These best practices are based on recommendations from vendors and countless experiences that were made in the community. All these experiences, tips and recommendations combined makes the manual how you should setup and configure a system. This also applies to SQL Server. Some of these best practices were already spotted on some PASS chapter meeting, SQL Saturdays and conferences.
Unfortunately, on the most SQL Servers you can find best practices only in rare cases. Most times performance issues or instability could be solved by implementing just these best practices. Starting at the BIOS settings, going through the Windows settings and for sure the SQL Server itself, I want to show you how to configure your SQL Server to make it a rock solid high performance data monster.
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
SQL Server Best Practices - Install SQL Server like a boss
1. SQL Server Best Practices
Install SQL Server like a boss
Andre Essing
Senior Consultant & Trainer
BASLE BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA
HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH
2. About Me
3 30.06.2016
ANDRE
ESSING
Senior Consultant
Trainer
DBA and Senior Consultant,
Microsoft Certified Solutions Expert,
Trainer and SQL Server Enthusiast
§ Working in IT since 1998
§ SQL Server since version 7.0
§ Focus on SQL Server infrastructure
and mission critical systems
§ Microsoft Certified Trainer
and MCSE: Data Platform
§ Microsoft P-TSP Data Platform
§ Friend of Redgate
§ PASS Chapter Leader Bavaria
and SQL Saturday Organizer
Contact
Web & Mail
www www.trivadis.com
Blog www.andreessing.de
E-Mail andre.essing@trivadis.com
Social
Twitter twitter.com/aessing
Xing xing.com/profile/Andre_Essing
LinkedIn linkedin.com/in/aessing
Publications
SlideShare slideshare.net/AndreEssing
Profile
SQL Server Best Practices - Install SQL Server like a boss
3. The Key for a Perfect System
SQL Server Best Practices - Install SQL Server like a boss4 30.06.2016
§ The key is to build a balanced system without bottlenecks
§ The SQL Server software is only a small part of the whole system
§ Plan your system before you build it
Processor Memory Storage HBA Networking
4. SQL Server Best Practices - Install SQL Server like a boss5 30.06.2016
Pre Deployment
5. Hardware
SQL Server Best Practices - Install SQL Server like a boss6 30.06.2016
§ Disable Hyper-Threading
§ 1 scheduler per logical core
§ Disable all power savings
§ SQL Server licenses are expensive
6. Storage
SQL Server Best Practices - Install SQL Server like a boss7 30.06.2016
§ Which kind of storage?
§ Read caching isn’t necessary
§ Prefer small disks
§ Low latency is important
§ Don’t use thin provisioning
§ Most times virtual disks are slower than physical
7. Filesystem
SQL Server Best Practices - Install SQL Server like a boss8 30.06.2016
§ Check partition alignment
http://msdn.microsoft.com/en-us/library/dd758814.aspx
§ Format volumes the right way
§ Disable file indexing and defrag
§ Disk layout is important
§ Consider a remote backup location
§ Use mountpoints
8. Operating System
SQL Server Best Practices - Install SQL Server like a boss9 30.06.2016
§ Configure for high performance
§ Use service accounts
§ Local Security Policy
§ Lock Pages In Memory
§ Perform Volume Maintenance Tasks
§ Antivirus software & exclusions
https://support.microsoft.com/en-us/kb/309422
§ Windows Firewall & User Access Control
9. SQL Server Best Practices - Install SQL Server like a boss10 30.06.2016
Setup
10. Installation
SQL Server Best Practices - Install SQL Server like a boss11 30.06.2016
§ Only install components you really need
§ Choose the correct collation
§ Install using a configuration file
§ Don‘t forget to install updates
§ BUILTINAdministrators isn’t a good idea
§ SQL Server is not a workstation
11. SQL Server Best Practices - Install SQL Server like a boss12 30.06.2016
Post Setup
Configuration
12. Networking
SQL Server Best Practices - Install SQL Server like a boss13 30.06.2016
§ Same port for all instances
§ Dedicated IP per instance
§ Use DNS alias for easy access
§ Set SPNs to use Kerberos authentication
§ Don’t use SQL Logins
13. Trace Flags
SQL Server Best Practices - Install SQL Server like a boss14 30.06.2016
§ Trace Flag 1117
§ Equally grows all data files
§ Replaced in 2016 by filegroup option
(AUTOGROW_ALL_FILES - sys.filegroups)
§ Recommended for all filegroups and databases
§ Trace Flag 1118
§ Force use of unified extents for objects
§ Replaced in 2016 by database option
(MIXED_PAGE_ALLOCATION - sys.databases)
§ Default in SQL Server 2016
14. Instance
SQL Server Best Practices - Install SQL Server like a boss15 30.06.2016
§ Configure memory limits
§ Optimize for ad hoc workloads
§ Max Degree of Parallelism
§ Not higher than cores per socket
§ Some apps need a value of 1
§ Cost Threshold for Parallelism
§ 40 for OLTP workloads
§ 25 for DWH and mixed workloads
15. Database defaults
SQL Server Best Practices - Install SQL Server like a boss16 30.06.2016
§ Default fill factor
§ Our best practice is 80%
§ It is just for new objects
§ Keep an eye on fragmentation
§ Compress Backups
§ Checksum default
16. TempDB
SQL Server Best Practices - Install SQL Server like a boss17 30.06.2016
§ Split into multiple files
§ Size depends on usage
§ Size and growth of the files
§ Start with 2-4GB per data file and 4-8GB log
§ Grow 256MB-1GB for data and 1GB for log
§ Monitor TempDB usage
§ Don’t forget trace flag 1117 and 1118
17. Databases – Physical design
SQL Server Best Practices - Install SQL Server like a boss18 30.06.2016
§ The physical design matters
§ When possible, primary filegroup only for MDF
§ Use multiple files per filegroup
§ Set size and growth of files
§ Estimate the size for the next year(s)
§ Keep an eye on VLFs
DBCC LOGINFO;
18. Databases – Options
SQL Server Best Practices - Install SQL Server like a boss19 30.06.2016
§ Don’t assign DB_Owner role or DBO
§ Always use Full Recovery Model
§ There could be some exceptions
§ Never enable Auto_Close or Auto_Shrink
§ Enable Auto_Create_Statistics
§ Enable Auto_Update_Statistics
19. Maintenance
SQL Server Best Practices - Install SQL Server like a boss20 30.06.2016
§ There are more tasks than just backup
§ Never shrink automatically
§ Don’t forget to clean the mess of SQL Server
§ Don’t use maintenance plans
§ Use scripts
§ Trivadis Toolbox (http://www.trivadis.com/)
§ Ola Hallengren (https://ola.hallengren.com/)