Presented at SharePoint Saturday Cambridge (2016)
An introduction to the different databases that SharePoint uses, with recommendations for High Availability, Disaster Recovery and configuration settings for SQL Server, including the constraints imposed in a single farm, a stretched farm between data centres and a separate DR farm.
3. blog.eardley.org.uk
Who Am I?
• SharePoint Architect at CPS
• Developer, DBA, Business Analyst, Project Manager, Architect
• SQL Server 7.0 - 2016
• SharePoint 2003 – 2016
• Office 365, Azure, Project Server/Online, Dynamics CRM
• Twitter: @Al_Eardley
• E-mail: Alan.Eardley@Outlook.com
• Blog: http://blog.eardley.org.uk
4. blog.eardley.org.uk
What will I cover?
• What does it do?
• How does it work?
• How does it use SQL?
What is SharePoint?
• How many databases does it need?
• How does it grow?
• HA & DR
Planning
• Are there any pre-requisites?
• How do I help with the build?
Roll-out
This relates to on-premises SharePoint
NOT Office 365
6. blog.eardley.org.uk
SharePoint – How does it work?
Lists & LibrariesSitesSite CollectionsWeb Applications
Intranet
Departments
HR
IT
Documents
Knowledge Base
Help Desk
Issues
Sales
Projects
Upgrade to Win
10
Risks
Issues
Tasks
Build new
Product
My Sites
Client Extranet
7. blog.eardley.org.uk
SharePoint – How does it work?
Business
Connectivity
Services
Managed
Metadata
Services
PerformancePoint
Services
Project Server Search
User Profile
Service
8. blog.eardley.org.uk
SharePoint – How does it use SQL?
• Most Service Applications utilise at least
one database
Service
Applications
• At least one database per Web Application
• Each site collection can have a database
Content
Databases
• Multiple DatabasesMy Sites
Databases should not exceed 200GB in
size
With the exception of Records Centre
databases
9. blog.eardley.org.uk
Remote BLOB Storage
• SharePoint 2016 only
• SQL Server 2014 (SP1)
• SQL Server 2016
• Uses FILESTREAM
• RBS Driver required on every SQL and SharePoint Server
10. blog.eardley.org.uk
Planning – How many databases does it
need?
• Types of Database
– Administration
– Content
– Service Applications
• How many databases will be required?
• How large do they need to be?
• How fast will they grow?
11. blog.eardley.org.uk
Service Applications with Databases
• App Management Service
• Apps for SharePoint
• Business Data Connectivity
• Managed Metadata
• PerformancePoint Services
• Search Service *
• Secure Store Service
• SharePoint Translation
Service
• SQL Server Power Pivot
Service
• State Service
• Subscription Settings Service
• Usage and Health data
collection
• User Profile Service *
• Word Automation Services
12. blog.eardley.org.uk
Versions
• SQL Server Power Pivot for SharePoint
– SharePoint 2016
– SQL Server 2016 (Ent)
– SQL Server 2016 AS
• SQL Server Reporting Services
– SharePoint 2016
– SQL Server 2016
– SQL Server 2016 RS
13. blog.eardley.org.uk
Backup
• As a DBA, same as any other application
– Full backups
– Differential backups
– Transaction backups
• Check consistency
• Fragmentation
– Check for index fragmentation
– Check for drive fragmentation
14. blog.eardley.org.uk
Recovery Overview
Site
• Everyone
• 30 days
• Items and documents
• Automatically moved
to site collection
recycle bin
Site Collection
• Site collection
administrator
• First in – first out
• Includes sites
15. blog.eardley.org.uk
Recovery
• When a site is required to be restored
• When a site collection has been deleted
Content
Databases
• When a Service application needs to
rebuilt
Service
Application
• When a farm needs to be recoveredCentral Admin
16. blog.eardley.org.uk
High Availability
• Mirroring
– SharePoint supports mirroring (although it is deprecated)
• Clustering
– Preferable to mirroring as it is at server level
• Always On Availability Groups
– Failover unit = group of databases
– No single point of dependency
17. blog.eardley.org.uk
• Web Front EndPresentation
• Application Server
• Workflow Manager
• Office Online Server
Application
• SQL ServerData
WorkflowManager
DataLayer
StorageLayer
DataLayer
OfficeOnlineServer
SharePoint -
WFE
SharePoint -
WFE
WorkFlow
Manager
WorkFlow
Manager
WorkFlow
Manager
Load Balancer
Load Balancer
SharePoint -
App
SharePoint -
App
Database
Server
Database
Server
Always On Availability
Group
Firewall
Load Balancer
Office Online
Server
Office Online
Server
Active
Directory
SAN SAN
18. blog.eardley.org.uk
Shared Services FarmsShared Services Farm
Content FarmLegacy Farm Project Server Farm
User Profile Service
Search
Managed Metadata ServicesSecure Store
Business Connectivity Services
20. blog.eardley.org.uk
Multiple Farms, Multiple Data Centres
Data Centre BData Centre A
SharePoint Farm
Firewall
SharePoint Farm
Firewall
Always On Availability
Group
SAN
Database
Server
Database
Server
SAN
Database
Server
SAN
Always On Availability
Group
21. blog.eardley.org.uk
Data Level
Domain
Data Centre B
WindowsServerFailoverCluster
Data Centre A
WindowsServerFailoverCluster
Asynchronous
Synchronous Synchronous
Domain
Controller
Scheduled
Backup and
Restore
22. blog.eardley.org.uk
How Can I Help?
• Set up SQL Instance correctly
• Understand the database usage profilesConfiguration
• Standards and processes
• PowerShellInstallation
• Monitor
• Plan for growth
• Backup
Maintenance
23. blog.eardley.org.uk
Instance Configuration
• Used a dedicated instance
• Default Collation - Latin1_General_CI_AS_KS_WS
• MAXDOP = 1
• Define the maximum memory
• Make a note of the Port Number the Instance is listening on
• Use DNS aliases
25. blog.eardley.org.uk
Support
• The general rules to not invalidate Microsoft Support are:
– Do not add anything to the SharePoint databases
• Stored Procedures
• Triggers
• Tables
• Indexes
– Do not run frequent queries against the SharePoint Databases
– Do not run DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS
26. blog.eardley.org.uk
Summary
• The number of databases depends on the service applications
• The size of the databases will depend on
– The number of users
– The number of documents and the amount of content
– The amount of usage of SharePoint
• A database instance for SharePoint has specific requirements
• HA and DR strategies are a combination of SharePoint and SQL approaches
• SharePoint databases are the same as any other databases
Web Application – a web site that contains at least one site collection
Site Collection – a container for sites and functionality configuration
Site – a container of lists and libraries and functionality configuration
List – a container of list items
Library – a container of documents
To plan we need to know how SharePoint works
Database recovery is generally to large a unit of recovery as users generally want a document or a site
Tools available for more granular recovery
SharePoint Service Applications
Search
User Profile
Managed Metadata
Secure Store
Business Connectivity
Dedicated Instance
Because of the security settings required to allow SharePoint to create databases and the default naiming conventions of SharePoint databases a single instance is recommended for each SharePoint Farm
More easy to manage when all of the databases within an instance are related to the same SharePoint Farm
If other custom databases are required because they are to be accessed from the same farm then they should be added to the same instance, e.g. SSRS or bespoke DBs
Easier for HA and DR
Collation
SharePoint is generally good at handling collations that differ from the recommended collation
The SQL generated by the application will explicitly set the collation
Issues arise when moving databases where the servers have different collations as comparisons used in TempDB will generate errors
MAXDOP
As of SharePoint 2013 a MAXDOP setting of 1 is required
Another reason to use a dedicated instance if other DB applications require different MAXDOP settings
Statistics
SharePoint will configure the settings when it is installing and when it is upgrading
Maximum memory
A simple safety check to prevent the instance claiming too much memory
Port Number