![Page 1: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/1.jpg)
#spsmad
May 7th, 2016SharePoint Saturday Madrid
Getting SQL Spinning with SharePoint –
Best Practices for the Back EndKnut Relbe-Moe
![Page 2: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/2.jpg)
#spsmad
Knut Relbe-MoeChief Technical ArchitectAdvania Knowledge Factory
http://sharepointblog.no@shareptkarmKnut is a Office Server & Services MVP, Nintex vTE, SharePoint and migration expert, conference speaker and blogger. Knut is MCSE SharePoint, MCSA Office 365 and MCT.
He delivers both engaging keynotes and highly technical sessions (level 400) on many different subjects in the Office 365 space. His job as an architect is to engage people and companies in evaluating and adopting new technologies as well as running key projects as a consultant. His core competence is to explain complex scenarios and make it understandable by combining technical insight and business value.
![Page 3: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/3.jpg)
Gold sponsors
Silver sponsors
Bronze sponsors
Collaborate
![Page 4: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/4.jpg)
#spsmad
Okay… Something is wrong with this picture…
![Page 5: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/5.jpg)
#spsmad
MS SQL Server is like the brain of your SharePoint environment
![Page 6: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/6.jpg)
#spsmad
So if the brain works slow, everything else will be slow….
![Page 7: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/7.jpg)
#spsmad
99.9% of SharePoint content stored in SQL Server Farm Configuration information stored in configuration db
Central Administration content stored in seperate content db
Most Service Applications have at least one db All Web Applications have at least one content db
![Page 8: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/8.jpg)
#spsmad
How to fix this
Follow the guidelines in this presentation Read and understand this whitepaper from Vlad Catrienscu
Maximizing SQL 2012 Performance for SharePoint 2013 WhitePaper If you have to reinstall MS SQL server as a new instance with the correct settings.
![Page 9: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/9.jpg)
#spsmad
Agenda Foundamentals 13 tips to get your SQL Spinning Summary
![Page 10: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/10.jpg)
#spsmad
Foundamentals
![Page 11: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/11.jpg)
#spsmad
SQL Server configurationFor SharePoint 2013:
• SQL Server 2008 R2 SP1• SQL Server 2012 (SP1 for BI)• SQL Server 2014 (SP2013 SP1 & April CU)
For SharePoint 2016:• SQL Server 2014• SQL Server 2016
Use a dedicated instanceRun the service with a Managed account•No specific permission
Use named instances\ SharePoint
![Page 12: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/12.jpg)
#spsmad
Tip 1
![Page 13: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/13.jpg)
#spsmad
Physical SQL Server will always outperform a virtual SQL server with the same specs, but what shall you choose.Pros : High availability because of the hypervisor, not because of clusteringEasier to scale up & downCan be easier to recover at Disaster Recovery
Cons:Very heavily loaded VMs have seen disk I/O issuesOver allocation of a virtual host. If you have too much running on a host, it's not just I/O that could be impacted.Harder to protect
Physical vs Virtual
![Page 14: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/14.jpg)
#spsmad
Tip 2
![Page 15: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/15.jpg)
#spsmad
DISKS
You should invest in as fast disk as possible If you run on a Virtual Server, consider physical disks for the SQL server
SSD or SAN If you have physical SQL server you should use at least 6 Disks:
1. TempDB 2. TempDB Logs 3. SharePoint Databases 4. SharePoint Databases Logs 5. OS 6. SQL binaries and other application Installs
![Page 16: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/16.jpg)
#spsmad
DISKS• You have a farm where most of the content is only read and
downloaded
• Your users will be collaborating, uploading documents, content
Speed/Scenario Read Intensive Scenario (ex Public Website) Fastest Tempdb data files and transaction logs . Database data files . Search databases, except for the Search administration
database Slowest Database transaction log files
Speed/Scenario Write Intensive Scenario ( collaborative workspace) Fastest Tempdb data files and transaction logs . Database transaction log files . Search databases, except for the Search administration
database Slowest Database data files
![Page 17: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/17.jpg)
#spsmad
Tip 3
![Page 18: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/18.jpg)
#spsmad
RAM & CPU
• Your SQL Server needs to have enough RAM to function properly.
• If your SQL Server runs only SharePoint, here are the minimum requirements Small Farm
Deployment (0-500GB of Data)
Medium Farm Deployment (501-1TB of data)
Large Farm Deployment (1-2TB of Data)
Very Large Farm Deployment (2-5 TB of Data)
Special Cases
Ram Required
8GB 16GB 32 GB 64GB 64GB+
CPU 4 4 8 8 8
![Page 19: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/19.jpg)
#spsmad
Tip 4
![Page 20: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/20.jpg)
#spsmad
DISKS
SQL server reads and writes 64k at a time So change your allocation size from the 4K default to 64K. This small change alone, will improve your SQL performance by up to 30%
Use chkdsk <drive>to Verify
Use Format to Configure:• Format <drive> /Q /FS:NTFS /A:64K
/V:<volume> /Y
![Page 21: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/21.jpg)
#spsmad
Tip 5
![Page 22: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/22.jpg)
#spsmad
Server Configuration – Collation SharePoint server 2013 is built to use Latin1_General_CI_AS_KS_WS. This is a quote from Microsoft to prove it:
“We support any CI collation for the SQL instance (for master, tempdb databases). However we recommend using Latin1_General_CI_AS_KS_WS as the instance default collation (master, tempdb databases).” CI – (Case Insensitive) A and a ARE treated as the same character. AS – (Accent Sensitive) a and á are NOT treated as the same character. KS – (Kana Sensitive) Japanese Hirakana and Katakana characters which look the same are
NOT treated as the same character. WS – (Width Sensitive) Single-Byte and Double-Byte versions of the same character are
NOT treated as the same character.
![Page 23: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/23.jpg)
#spsmad
Server ConfigurationFor SharePoint 2013:
• SQL Server 2008 R2 SP1• SQL Server 2012 (SP1 for BI)• SQL Server 2014 (SP2013 SP1 & April CU)
For SharePoint 2016:• SQL Server 2014• SQL Server 2016
Use named instances\ SharePoint
Use a dedicated instance
Run the service with a Managed account•No specific permission
![Page 24: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/24.jpg)
#spsmad
Server ConfigurationUse alias for the connection string• Client alias or DNS alias (preferred)
Good practice : every SP Content db must be created (and documented) by a DBA after a strict capacity plan
![Page 25: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/25.jpg)
#spsmad
Server ConfigurationUse alias for the connection string• Client alias or DNS alias (preferred)
Good practice : every SP Content db must be created (and documented) by a DBA after a strict capacity plan
![Page 26: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/26.jpg)
#spsmad
Server Configuration Backups Compression
![Page 27: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/27.jpg)
#spsmad
Tip 6
![Page 28: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/28.jpg)
#spsmad
Click to insert photo.
Max Memory
Thomas Larock from SQL Rockstar explains this:
SQL Server (and other database systems such as Oracle and Sybase) need to read data pages into their internal memory before they can be used. Of course your server needs memory to operate as well. When your database engine and your server are competing for the same memory resources, you get bad performance. You want your server and your database engine to be like dancing partners, and less like my kids fighting over the last cupcake.
Max Memory
![Page 29: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/29.jpg)
#spsmad
Tip 7
![Page 30: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/30.jpg)
#spsmad
Optimize TempdB Split across n locations
N = total number of physical cores > super myth All temp files need to have the same size
Size of largest content dB or 10 % of Total Content DB’s Size whichever is bigger
The fastest disk possible | Place on a different Drive than the Content Database
Simple Recovery mode Place on Different Drive Than Content Databases
![Page 31: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/31.jpg)
#spsmad
Model Database
SQL Server uses the Model database as a template for creating new user databases
So therefor make sure that Model database have correct initial size and growth settings. The log should be around 25% of the initial size. The auto growth is your insurance policy if your current database size has been reached.
![Page 32: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/32.jpg)
#spsmad
Script
![Page 33: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/33.jpg)
#spsmad
Tip 8
![Page 34: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/34.jpg)
#spsmad
Auto Create Statistics
Do not enable auto-create statistics on a server that hosts SQL Server and SharePoint Server
Enabling auto-create statistics is not supported for SharePoint Server
![Page 35: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/35.jpg)
#spsmad
Tip 9
![Page 36: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/36.jpg)
#spsmad
USE “DBA” created databases
Sizing Autogrowth DO NOT USE SIMPLE RECOVERY
Unless you understand the implications
![Page 37: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/37.jpg)
#spsmad
Tip 10
![Page 38: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/38.jpg)
#spsmad
Maintenance Plan
Create a maintenance plan to backup databases, rebuild indexes and checking the logical and physical integrity of your database
Make sure you don’t run backup when heavy timer jobs runs in the SharePoint environment, like midnight
![Page 39: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/39.jpg)
#spsmad
Recovery mode
Model db : recovery model = full
Tempdb : recovery model = simple
SharePoint DB : recovery model ?
Contend DB = full Config DB= simple
Services App DBs= it depends :•http://technet.microsoft.com/en-us/library/cc678868.aspx
![Page 40: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/40.jpg)
#spsmad
Tip 11
![Page 41: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/41.jpg)
#spsmad
Script your SQL Server installation https://sqlserverfinebuild.codeplex.com/
![Page 42: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/42.jpg)
#spsmad
Tip 12
![Page 43: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/43.jpg)
#spsmad
Always install SQL Alias in SharePoint
Use alias for the connection string• Client alias or DNS alias (preferred)
![Page 44: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/44.jpg)
#spsmad
Tip 13
![Page 45: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/45.jpg)
#spsmad
Using SQL Server Resource Governor to optimize Search Database usage Part of SQL Server Enterprise (since SQL 2008) Limits CPU and memory usage on some DBs (and IO in SQL Server 2014) like search DBs
Allow less CPU & mem & IO usage during work hours Allow more CPU & mem & IO usage during off hours
![Page 46: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/46.jpg)
#spsmad
Summary
![Page 47: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/47.jpg)
#spsmad
10 simple tips to maximize performancehttp://www.sharepointblog.no/?p=851. SSD Disk or better2. Formating disk with 64K3. Language corralation Latin_CI_AS_KS_WS4. Maximum memory5. Changed Sizes on Model database6. Default fill factor to 807. Switched of autocreate statistics8. Max Degree of Parallelism – set to 1 (it has to be)9. Changed Initial Size & Autogrow on temp database, and created extra temp
files for the amount of processors.10. Don’t do backups at midnight.Maximizing SQL 2012 Performance for SharePoint 2013 WhitePaper by Vlad Catrinescu
![Page 48: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/48.jpg)
#spsmad
Questions?
Speaker picture
@shareptkarmOffice Server & Services
![Page 50: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/50.jpg)
Gold sponsors
Silver sponsors
Bronze sponsors
Collaborate
![Page 51: SPSMadrid Get sql spinning with SharePoint. Best practice for the back end](https://reader031.vdocuments.mx/reader031/viewer/2022030303/587b9ae71a28ab4e4f8b76d7/html5/thumbnails/51.jpg)
#spsmad
RafflePlease, fill your SPS Madrid passport if you want to participate.You must get signature from sponsors and complete the poll.Give us the passport at 6:00 PM in the Auditorium room.You can win one Sphero BB-8 or a mini drone: