Upload
thomas-vochten
View
542
Download
2
Embed Size (px)
DESCRIPTION
Citation preview
SharePoint and the Involuntary DBA
COM715
Thomas Vochten
Thomas Vochten
@thomasvochten thomasvochten.com [email protected]
SharePoint consultant. Platform architect. Speaker. Trainer. Accidental DBA.
Agenda
SharePoint & SQL Server SQL Server Fundamentals Preparing the platform Performing a deliberate installation Real world configuration tips Operational guidance Useful tools & resources
I’m not a professionally trained DBA
Meet the involuntary DBA
Someone who is made to assume a DBA role or take on DBA responsibilities, usually
against their will (*)
(*) Paul Randal
The Dynamic Duo
SharePoint & SQL Server
Importance to SharePoint
SharePoint performance impact Almost everything is stored in SQL Support for your HA/DR strategy
SharePoint 2013
Many schema optimizations Reduced IO operations Distributed Cache Shredded Storage
Shredded Storage
Evolution from SharePoint 2010 Document is stored as separate BLOB’s
in SQL Server Only changed BLOB’s will be sent back to
SQL Server Reduced IO & Storage needs
Database, anyone?
A lot of SharePoint databases Each with different needs
Limits & boundaries
Content database sizing
200 GB still the sweet spot 4 TB if you know what you’re doing … or even unlimited
Limits & boundaries
Content database limits
500 content databases per farm 60 million items in a content database 10.000 site collections in a content
database*
* 5000 is recommended
Supported Versions of SQL
SQL Server 2012 x64 SQL Server 2008 R2 Service Pack 1 x64
Editions supported:Standard, Enterprise, Datacenter
SharePoint makes DBA’s cry
Unconventional practices Support policy GUIDS all over the place
Get rid of the GUID
Grey wizard
GOOD
White wizard
BAD
PowerShell to the rescue
New-SPConfigurationDatabase AutoSPInstaller Naming convention matters!
http://autospinstaller.codeplex.com
SQL Server Fundamentals
SQL Server Storage Primer
Use of 8K pages in data files Use of 64K as basic unit of space Database files (.mdf) & Log files (.ldf) Indexes
SQL Server databases
System databases
master, model, msdb, tempdb
User databases (SharePoint)
config, content, search, …
TempDB
Give it proper care Initial sizing Number of data files Dedicated drive Tune autogrowth
Recovery Models
Essential reading:
Understanding Logging & Recovery
http://technet.microsoft.com/en-us/magazine/2009.02.logging.aspx
Simple recovery model - last full backup Full recovery model - up to the minute
Simple or full
“Why does this log file grow forever?”
Demo
CONTROL LOG FILE GROWTHLearning about the full recovery mode
Simple or full
“Why does this log file grow forever?”
Full recovery model requires log backups
Preparing the platform
General considerations
SQL is all about mem/disk IO/cpu Dedicate a SQL instance to SharePoint Virtualizing SQL Server?
Plan your disks
Differentiate & prioritize based on IO needs
1. tempdb
2. logs
3. search
4. other databases
Prepare your disks
Check/modify:
Up to 50% io performance gains measured!
Partition alignment 1024K everywhere
Allocation unit size 64K for SQL data & logs
diskpart
list disk
select disk <DiskNumber>
create partition primary align=1024
assign letter=<DriveLetter>
format fs=ntfs unit=64K label="<label>" nowait
Prepare your disks
Prepare your disks
Test the disks you get offered Sqlio to the rescue (or even
CrystalDiskMark)
Demo
PREPARE YOUR DISKSPartition alignment & allocation unit size
Deliberate Installation
Running Setup
Only install the features you need Use domain user as service account Don’t lock out other admins Configure data & log file placement Set the right collation:
Latin1_General_CI_AS_KS_WS
Patching SQL Server
Service Pack Cumulative Updates
Post setup
Enable instant file initialization
Speeds up data file creation enormously Disables zeroing out data files Does not work for log files Set “Perform volume maintenance tasks”
Demo
INSTANT FILE INITIALIZATIONSpeeding up your data file operations
Configuration Tips
Don’t forget
Start SQL Server Agent Set up alerting for specific events Don’t forget about Windows Firewall
(open port 1433)
Instance level settings
Determine maximum memory Set fill factor to 80 Turn on backup compression Set MAXDOP to 1
Setting MAXDOP is now mandatory in SharePoint 2013
Database level settings
Consider multiple data files Tune autogrowth settings Presize databases Recovery model (simple or full) Read-only databases
Connecting SharePoint to SQL
Use SQL aliases for added flexibility Test your connection beforehand Grant the correct rights to the setup
account (dbcreator, securityadmin)
Demo
CONFIGURATION TIPSSQL Agent, Instance & Database level settings, Aliases
Operational Guidance
Required Reading
KB841057 supported & unsupported actions to databases
Database Maintenance for SharePoint 2010 Products
* Still relevant for SharePoint 2013
Regular maintenance
Check database integrity (dbcc checkdb) Check index fragmentation Learn about maintenance plans
Index fragmentation
Check “sys.dm_db_index_physical_stats”Illustration by Paul Randal
* Illustration by Paul Randal
Reducing fragmentation
SharePoint Health Analyzer Perform index rebuild manually Set the fill factor to 80
Consider rebuilding indexes when fragmented over 30% (for content
databases)
Watch out for the shrink
Just because you can,
doesn’t mean you should
Causes massive fragmentation Rebuild indexes & keep free space Autoshrink is the root of all evil!
Demo
OPERATIONAL GUIDANCEDatabase maintenance and the danger of shrinking
Tools & Resources
Database Maintenance
Invaluable scripts for backup & consistency checks
http://ola.hallengren.com/
Counter Intelligence
Blitz! scripts by Brent Ozar
http://brentozar.com/blitz
Diagnostic scripts by Glenn Berry
http://sqlserverperformance.wordpress.com/
PAL Tool
http://pal.codeplex.com
Demo
COUNTER INTELLIGENCEUsing scripts to quickly assess the health of a SQL Server
Tuning SQL Server 2012 for SharePoint 2013 Jump Start
4 hours of video by Bill Baer & Brian Alderman
https://www.microsoftvirtualacademy.com/training-courses/tuning-sql-server-2012-for-sharepoint-2013-jump-start
ResourcesWhere do I go for SQL help?
Paul Randal (blog | twitter)
Kimberly Tripp (blog| twitter)
Brent Ozar (blog| twitter)
Glenn Berry (blog| twitter)
Fancy some blogs?
http://thomaslarock.com/rankings
Get help – fast!
#sqlhelp on Twitter
Key Takeaways
Know limits & boundaries Understand logging & recovery Plan disk layout & configuration Enable instant file initialization Use PowerShell for more control Tune instance & database settings Use SQL aliases Check for consistency (weekly)
Thank you for attending!
@thomasvochten