Vous êtes sur la page 1sur 47

Deep dive to SQL Server for

SharePoint 2013

Gokan Ozcifci
SharePoint MVP
Managing
Consultant Neoxy

SharePoint Saturday Jersey


September 27th 2014

@gokanozcifci
1

Deep dive to SQL Server for


SharePoint 2013

Patrick Guimonet
Abalon

SharePoint Saturday Jersey


September 27th 2014

Benoit Jester
SPasipe
2

Apologies for accent


Im from Belgium a French speaking
guy and they are Frenchie's!

Im not a real DBA!


My role:

Install the SharePoint farm

Manage solutions developed by developers

Administer the Farm

Architectural changes as decisions

Your role:

Managing the SharePoint Databases

Maintenance Plans
Performance

Installation and Configuration of SQL Server


Backups and Maintain

Iceberg SharePoint

SharePoint++
SharePoint is not only DEV!
C#

CSS

Silverlight

ASP.NET

JQuery

XML

Web Services

SQL Server, only for IT-PRO?


Still Dev?

T-SQL

Linq

C#

Design

Modelisatio
n

MDX/DAX

SharePoin
t

SQL Server

SharePoint makes you guys -DBAs- crazy!


Many DBs for SharePoint Server
Many Guids (Product Configuration Wizard)
PowerShell, SPAutoInstaller
Rename DB Well, not so easy if governance is
there
Dont touch policy
If you touch the DB Loose your support
SharePoint does his way. The SQL best practices are
not the same as SQL for SharePoint
Complex to manage
Every update changes the schema!
Zero downtime is not achievable

The SharePoint tree

Farm
Service Application
Service Application DB
Servers
Web Applications
Site Collections
Sites
Lists
Elements
Content Database

Hardware Requirements (SQL)


Processor
64bits, 4 cores for small deployments
(< 1.000users)
64bits, 8cores for medium deployments
(between 1.000 and 10.000users)
RAM
8 GB for small deployments
(less than 1.000 users)
16GB for medium deployments
(between 1.000 and 10.000 users)
Hard Disk
80Go minimum

(G) SharePoint et SQL What to know


Configuration
is on SQL

Content
Databases
are in SQL

32 or even
more
databases for
a simple farm

Service
Applications
are in SQL with
their own
Database

SharePoint
sites can have
several DB

SQL use for SharePoint


Databases to SharePoint 2013 are automatically created with the SharePoint
Products Configuration Wizard
Use PowerShell to create a naming convention
SVR_DOMAIN_ENV_PRODUCT
V_NEOXY_P_SharePoint
V_NEOXY_D_SharePoint
Microsoft does not support direct questioning or changing databases SharePoint
2013
SharePoint databases have different best practices and limitations that are
not standard for SQL Server

SQL Server 2012


SharePoint Foundation 2013 is not compatible for BI. You need the Enterprise
version
SSRS is now a dedicated service in the:
Central Administration
Or via PowerShell.
AlwaysOn

SharePoint and SQL is great if

CPU

RA
M
ABCK

HD

In a few words
IMHO = The SQL Server is the hart of your SharePoint Farm.
4 Layers
o SQL Server
o Application Server
o Index Server
o Excel Application
Server
o Others
o Web Front-Ends
o Workstations

Before the installation

You need to choose:


SQL Server: Express, Datacenter, Standard,
SharePoint Server : Stand alone or not?
Hardware
P
V
Service Applications that Business requires
User Profile Service Application = 3 DB
Search Service Application = ??
How to configure the Service Applications = PowerShell or UI?
Naming convention
At least 2 farms ( D and P )= Otherwise you dont have a Production
env.
Not more ideologies like Next > Next > Finish

Prerequisites for SharePoint 2013

Supported SQL Servers : Express, Standard, Enterprise, Datacenter


Nice to knows:
SQL Server 2014 needs CU of may 2014 for SharePoint 2013
Windows 2012 R2 is only supported with SharePoint 2013 SP1

Plan your Installation


SP_Install

Domain user

securityadm
in

Local
Administrator

dbcreator

Accounts to plan for a SharePoint farm installation


Install account
Farm account
SQL Server account
Plan for least-privileged administration in SharePoint 2013
Plan for administrative and service accounts in SharePoint 2013

Plan, plan and plan again


This is the golden formula: DB size= ((D V) S) + (10 KB (L +
(V D)))

D = Number of Documents
V = Number of Versions
S = Average Size of documents. Must be above Zero!
L = Number of List items
(D)
(S)
(L)
(V)

200,000
250KB
600,000
2

DB size= (((200,000 x 2)) 250) + ((10 KB (600,000 + (200,000 x 2))) =


110,000,000 KB or 105 GB

SQL Server Conception


Master

Model

MSDB

TempDB

BDD
systmes

User DB

SharePoint DB

How to install SQL

Install only the necessary SQL services

Always follow the best practices of Microsoft

Only Windows Authentication

Configure the alerting for specific events has SQL

Log Farm

Try to avoid mixed mode

If you have corporate best practices; thats another story

Use dedicated accounts (ref. Image)


Configure the paths of data and log file

SharePoint only needs Database Engine Services (ref. Image)

SCOM

Windows Firewall

1433
1434

Installation Settings(1/2)

Reference: Thomas Vochten slides

Installation Settings (2/2)

Reference: Thomas Vochten slides

Disk Setup
Drive
Letter

Purpose

LUN

C:\

System (OS)

D:\

User Data

L:\

SQL Log Files

P:\

Page File

R:\

Local Backup Store

S:\

SQL Server System


Databases

T:\

TempDB

SharePoints way more frustrations!

Auto Create Statistics = off


Auto Update Statistics = off
Model Database is not really used by SharePoint
Naming conventions
Impact of SharePoint creating databases:

Backups
HA & DR techniques
database options

(B) Best practices of the instance

MAXDOP should be set to 1


Collation Latin1_General_CI_AS_KS_WS for SharePoint DB

If not, you cannot change it


Format disk is the only way

Use a dedicated SQL Instance

Limite the mmoire (*0,80)

max.

min.
Fill Factor at 80%

For SP2013 not anymore

Create a maintenance plan


tempdb to modify
On a speedy disk!
Autogrowth in MB
Enable backup compression
NO auto-shrink !
Re-index

Monitor SQL and SP


Monitoring : Health Analyzer, SCOM, PowerShell, Logs
Certaines bases de donnes de contenu deviennent trop volumineuses (SharePoint2013)
Content databases contain orphaned Apps (SharePoint 2013)
La base de donnes dispose de trop despace inutilis (SharePoint2013)
Des bases de donnes existent sur des serveurs excutant SharePoint Foundation (SharePoint2013)
Des bases de donnes fonctionnent en mode plage de compatibilit, mise niveau recommande (SharePoi
nt2013)
Des bases de donnes ncessitent une mise niveau ou ne sont pas prises en charge (SharePoint2013)
Les bases de donnes dans cette batterie de serveurs sont configures en lecture seule. Pour tre mises niv
eau, elles doivent tre dfinies en lecture-criture. (SharePoint2013)
Des lecteurs utiliss pour les bases de donnes SQL manquent despace libre (SharePoint2013)
Des bases de donnes utilises par SharePoint contiennent des statistiques dindex obsoltes (SharePoint2
013)
Rechercher - Une ou plusieurs bases de donnes danalyse peuvent contenir des index fragments (SharePo
int2013)

ULS Viewer

Backup - Principles

Try to backup as much as possible


Content DBs are the most important
But they are not alone
Windows level backup still needed
Recovery model : Simple or Full
model = full
tempDB = simple
content= full
configuration = full
services Applications = simple / full

Backups: Best Practices (1/2)

SQL backup locally preferred


On a different hard disk SQL Server
SSD?
If network drive, latency of 1 ms
Do not save all databases simultaneously
Plan
Datacenter
Is there something else already running
Performance
Usage
Avoid having too large BDD
Respect the best practices
For collection site, the strategy differs according to size
(PowerShell, SQL Server or DPM)

Backups : Best Practices (2/2)

Make sure you have enough disk space


Periodically test the backups AND restores
Save the ULS logs
Keep three backups, including one off-site
Save the installation data for SharePoint
Have an iso-prod environment (Disaster Recovery)
Use PowerShell scripts Schedules

Use a dedicated SQL Server


For optimal performance when operating server
farms, we recommend that you install SQL Server
2008 R2 with SP1 and SQL Server 2012 on a
dedicated server that is not running other roles
of farm and n 'not host databases for other
applications

35

Parameters specific to SQL Server

Do not enable the automatic creation of statistics on a server that


hosts SQL Server and SharePoint Server. This is not supported by
SharePoint Server. Manual activation of the automatic generation of
statistics on a SharePoint database can radically change the execution
plan for a query

Set the maximum degree of parallelism (MAXDOP) of 1 for instances


of SQL Server that host SharePoint databases to a single SQL Server
process is associated with each request.

To simplify maintenance, as to facilitate moving databases to another


server, create DNS alias that points to the IP address of all instances
of SQL Server.

Disks in SQL Server

Improve their performance (from 30 to 50% !)


Format with 64K NTFS allocation
Check partition alignment (1024K) with PowerShell scripts
Test the disks (Disk Seconds Per Read/Write < 20 ms)
SQLIO
CrystalDiskMark
Some databases are used intensively (tempdb, logs, search, )
RAID 10
Defragment the disks where content databases are hosted

SQL Server : Disks configuration


Databases must reside on separate disks
Tempdb
Bases de contenu
Usage
Search
Logs SQL Server
Prioritize data on disks (from the more to the less fast)
Tempdb
Databases (logs)
Search databases
Databases (data)
If SharePoint is mainly used for reading, prioritize data on logs
Separate data and logs on different disks

High disponibility
SharePoint supports:
SQL Server mirroring, log shipping, clustering, availability
groups
Analysis Service instance for SharePoint mode does not

support clustering

Always On Availability Groups & SharePoint


(HA)

Production

FARM 1

Jersey

Synchronous

SQL 1

SQL 2

High
Availabilty

Always On Availability Groups & SharePoint


(HA)

Production

FARM 1

Jersey

Synchronous

SQL 1

SQL 2

High
Availabilty

Database Support Sync Commit


Database

Supported

Database

Supported

Admin Content

Yes

Search Crawl

Yes

App Management

Yes

Search Links

Yes

BDC

Yes

Secure Store

Yes

Config

Yes

State Service

Yes

Content

Yes

Subscription Settings

Yes

Managed Metadata

Yes

Translation Services

Yes

PerformancePoint

Yes

UPA Profile

Yes

PowerPivot

Not Tested

UPA Social

Yes

Project

Yes

UPA Sync

Yes

Usage(=loggingDB)

Yes NR

Word Automation

Yes

Search Analytic Reporting Yes


Yes
Search Admin

WE

Always On Availability Groups & SharePoint


(DR)

Production

FARM 1

FARM 2

Jersey

Synchronous

SQL 1

SQL 2

Asynchronous

SQL 3

DR
Paris

Database Support Async Commit


Database

Supported

Database

Supported

Admin Content

No

Search Crawl

No

App Management

Yes

Search Links

No

BDC

Yes

Secure Store

Yes

Config

No

State Service

No

Content

Yes

Subscription Settings

Yes

Managed Metadata

Yes

Translation Services

Yes

PerformancePoint

Yes

UPA Profile

Yes

PowerPivot

Not Tested*

UPA Social

Yes

Project

Yes

UPA Sync

No

Search Analytic Reporting

No

Usage

Yes NR

Search Admin

No

Word Automation

Yes
WE

This is a journey
0 Memory and CPU
prerequisite
1 page file

4.1 A dedicated
server
4.2 consider RBS
4.3 an alias
5 Instance parameters
5.1 Collation
5.2 Installation directory
5.3 Memory
5.4 Compress backup
5.5 Default directories
5.6 MAXDOP = 1

2 Power Options
3 Disks
configuration
3.1 Allocation size
3.2 Alignment

6 System DBs
5.1 TEMPDB
5.2 MODEL
6 SharePoint DBs
6.1 Autogrowth
6.2 Recovery model
6.3 Auto*

Takeaways

SharePoint is what it is, do not try to change


Work with your SharePoint administrators
Be aware of the limitations
Know what is supported or not
Get involved when they are considering using
SharePoint!

Thank You!
Raffle Prizes at 16:00
1st #SharePint in the Hotel Bar sponsored by
Cloudshare 16:30

Gokan, Patrick and Benoit!


SharePoint MVP

47