Download presentation
Presentation is loading. Please wait.
1
SQL + SharePoint: Friends Forever
William Assaf Cody Gros Sparkhound SLIDE PURPOSE: This is where everything starts – us defining with our customers how we can make an impact in their business regardless of the technology! SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
2
Why? Microsoft SQL Server instances which host SharePoint databases are very similar to other instances, and need the same attention. We will discuss common SharePoint database configuration and maintenance needs. This introductory-level presentation is geared towards the basics of administration in existing environments.
3
SQL Best Practices for SharePoint or SharePoint Best Practices in SQL?
4
SQL Best Practices for SharePoint
5
The Number One Emergency Call
“Help, my SQL Server has filled up the drive!” Why does this happen? Only one real reason ever exists – a SQL Server Transaction Log file has grown unchecked.
6
The Transaction Log Windows sees 1GB file SQL sees 1GB reservation
with ~1GB free Windows sees 1GB file SQL has used up the space, the file must grow Transactions +10% Transactions +10% Transactions Windows sees 1.1GB file SQL sees 1GB reservation with ~.1GB free Windows sees 1.21GB file SQL sees 1GB reservation with ~.11GB free Transactions Transactions Transactions Transactions .LDF file
7
Database Recovery Model and the Transaction Log
Simple Transactions quickly, automatically cleared from the T-Log No T-Log backups No Point in Time Recovery (Full/Diff backups only) Full Transactions stay in T- Log until truncated T-Log backups taken regularly –or– T-Log will grow unchecked! Point in Time recovery is possible and desirable
8
The Transaction Log Windows sees 1GB file
A transaction log backup occurs Transactions are copied to a backup, T-Log is emptied Windows sees 1GB file SQL sees 1GB reservation with ~1GB free Windows sees 1 GB file SQL Server activity begins to fill up the transaction log again Transactions Transactions Transactions Transactions Transactions .LDF file
9
SharePoint Database Recovery Models
These database should be in SIMPLE recovery mode. Nightly full backups are still necessary. Config databases, Search and Crawl databases, Usage and Health Data Collection database, SharePoint Profile-related databases, and SQL Server system databases
10
SharePoint Database Recovery Models
All other databases, including Content DB's, and the Secure Store, should be in FULL recovery mode. Nightly full backups plus hourly tran log backups are necessary.
11
SQL Server Alignment Host no other databases or applications on the Windows Server that hosts the SQL Server instance, including other SharePoint farm features Configure each of these on separate volumes (these can be moved, transparent to SharePoint): Operating System (C:) SQL Server Data Files and system databases SQL Server Log Files SQL Server TempDB (fastest available) SQL Server and SharePoint backups
12
SharePoint SQL Server Properties
Max Degree of Parallelism should be set to 1 Max Server Memory should be set appropriately
13
SharePoint SQL Server Properties
Appropriate SQL Server instance memory Total Server Memory minus 2gb or 10%, whichever is larger. For a server with 10gb of RAM:
14
SharePoint Database Settings
Auto Create Statistics on each database should be FALSE These settings should also never be enabled on ANY SQL Server database: Auto_Close Auto_Shrink NEVER!
15
Disaster Recovery Recovery Point Objective (RPO)
Point in Time to restore Defined by Data Loss Tolerance Recovery Time Objective (RTO) Amount of time before System or Application should be restored, different for each Allows IT to prioritize recovery and budget
16
SQL Server Disaster Recovery
SQL must back up SQL The transaction log is a big reason and benefit of this Offsite the Backups ASAP No DR solution without a copy to another location You must back up the System Databases: Master, Model and MSDB databases must be backed up! SAN Replication, VM Server snapshots, VM backups are useful and complimentary but not a replacement for recovery from corruption disasters, for point in time recovery, or for SQL instance recovery.
17
SQL Server TempDB The highest-activity database files on your SQL Server instance will be in the TempDB data file. The TempDB data file(s) should be on the fastest possible storage (SSD) Myth: create TempDB data files equal to the number of logical CPU cores Fact: create multiple TempDB data files, but probably no more than half of the number of logical CPU cores. There is no simple rule. All the TempDB data files must be the same size and have the same autogrowth settings.
18
Compression Backup Compression – As of SQL 2008 R2 - this is now a Standard edition feature Data Compression - Enterprise only Transparent Data Encryption (TDE) - Enterprise only TDE conflicts with Backup Compression (in a bad way) but not Data Compression
19
Basic SQL Maintenance Plan
Database and T-Log Backups Can’t do Site Collection Backups at the SQL Server level, can do them in Central Administration or PowerShell. Check database integrity Do not Shrink! In SharePoint 2013, probably don’t need: Rebuild Indexes (ONLINE) -or- Reorganize Indexes + Update Statistics Health Analyzer will monitor index statistics and automatically “repair” by updating statistics.
20
Reporting Services SSRS is a SQL Server feature included with the SQL license for serving Enterprise-scale web-based reports. Two install options: Standalone – operates as its own webserver, at scale should have its own Windows Server. SharePoint integrated (SharePoint 2013 only) – operates inside the farm as a Web Application Requires also installing the Reporting Services Add-in Both support scale-out for round-robin report serving.
21
Reporting Services Should I use SSRS native or SSRS in SharePoint integrated mode? Consider security. Standalone SSRS is secured separately from everything else via Windows Auth Groups in SSRS Report Manager. SharePoint Integrated SSRS is secured with SharePoint credentials. Anonymous access is not possible. Do you already have investment in SharePoint security infrastructure?
22
AlwaysOn Availability Groups
Starting with SQL 2012 Enterprise, Availability Groups are an excellent marriage of Database Mirroring and Clustering to provide: Multiple database nodes, each with their own async/sync options Wide geography WAN synchronization is easy Manual or automatic failover Read-only secondary mirrors Third SQL Server can serve as a listener to provide redirection and failover if desired
23
AlwaysOn Availability Groups
With SharePoint, Availability Groups should really only be set up to synchronize Content Databases between 2+ distinct SharePoint farms. All SQL system and SharePoint config databases reside locally and should not synchronized. These are farm- specific databases. During a planned failover, you must first dismount the content databases, failover the Availability group, then mount the content databases (easily accomplished with PowerShell)
24
SharePoint Best Practices In SQL
25
agenda 1 Overview of SharePoint and SQL integration 2 SQL Basics 3
Optimizing SQL Server
26
1 Integration
27
Sharepoint & SQL Integration
Over 90% of SharePoint content is stored in SQL Lists Libraries Farm Configuration Information Search Information Service Application Information Remote BLOB Storage(RBS)***
28
Remote blob storage Highly recommended
Binary files >256KB will benefit from being stored on NTFS instead of in database Typical implementation of uses the SQL Server FileStream feature as the RBS provider, this requires Enterprise edition, 2008R2+ All access to the files must be through SharePoint Keep in mind the backups are slightly different
29
Content Databases SharePoint farms can have several Content databases
Each SharePoint farm has one Config database Web Applications in SharePoint can have one or more Content databases A site collection can be mapped to its own content database
30
Content Databases Carefully consider how much information will be contained in your content databases Create database with enough space for around one year’s worth of growth
31
Content Databases The Content Databases will become the largest databases. Maintain them below ~200gb of data. Proper SharePoint governance (another session) will limit the size of individual Site Collections and therefore limit the size of Content Databases If a Content Database is >200gb, move Site Collections out and into a new Content Database. You can do this through SharePoint manually. Use PowerShell to automate Site Collection level backups. Third party tools can also offer this down to the item level.
32
Service Application Databases
Business Connectivity Services Managed Metadata Performance Point Search Secure Store State Service Usage and Health User Profile Service
33
Supported versions of SQL for SharePoint 2010
SQL 2008 R2+ MUST BE 64 BIT Basic install of SharePoint installs SQL 2008 Express DO NOT DO A BASIC INSTALL! 4 GB DB limit 8 GB DB limit if you upgrade to SQL 2008 R2 Express Cannot install SharePoint on Windows Server Core.
34
2 SQL Basics
35
DATABASE Files Three types of files associated with each SQL Server database: Primary Data File - .mdf Transaction Log File - .ldf Secondary Data File - .ndf (Optional) The file extensions actually don’t matter, these are standards, but don’t deviate.
36
SYSTEM Databases Master Msdb Model Tempdb
37
Master Contains all the required information that the database engine reads when it starts up Stores: Security File locations Sort orders Database locations Essential to the success of the SQL Server instance functioning properly
38
Msdb Contains information used by the SQL Server Agent Service
Scheduled Jobs SQL Server Operators SQL Server Alerts Information about data maintenance plans
39
MODEL Template database
Modifications to this database are prudent (more on this later) Should never contain data.
40
Tempdb Work area that the database uses to temporarily store data
Similar to cache Every time the MSSQLServer service is restarted, its contents are deleted and it begins empty Always change the initial file sizes Will resize down to 8mb data, 1mb log file by default upon restart
41
3 Optimizing SQL Server
42
Modifying the Model Database
Every SharePoint database inherits most of its settings from this database Inherits the following properties: Initial size of the primary data file Initial size of the transaction log Recovery Model
43
Autogrowth settings Autogrowth settings on Model database will not be applied to databases created in Central Administration. Default setting for data files is 1MB and 10 percent for the transaction log Should definitely change – typically to a fixed growth rate of 500mb-1gb Changes must be made after content database is created Autogrowth setting What is the proper setting? Unused. Do not rely on the autogrowth option to manage your data file and log file size, be a proactive DBA. Configure a SQL Alert to notify of impending log file autogrowths.
44
Autogrowth settings Autogrowth settings on Model database will not be applied to databases created in Central Administration. Default setting for data files is 1MB and 10 percent for the transaction log Should definitely change – typically to a fixed growth rate of 500mb-1gb Changes must be made after content database is created Autogrowth setting What is the proper setting? Unused. Do not rely on the autogrowth option to manage your data file and log file size, be a proactive DBA. Configure a SQL Alert to notify of impending log file autogrowths.
45
Tempdb Place the Tempdb database on the fastest I/O subsystem available. Pre-allocate space for your Tempdb files
46
QUESTIONS ?
47
THANK YOU !
48
Useful Links tuning-for-sharepoint-part-1.aspx tuning-for-sharepoint-part-3-tempdb.aspx configuration-and-considerations-for-sharepoint-2010.aspx on-sql-server-alwayson-2014-edition.aspx
49
One more session from Sparkhound this afternoon:
SQL Server Best Practices with DMVs 3:00pm Room 210 William Assaf SLIDE PURPOSE: This is where everything starts – us defining with our customers how we can make an impact in their business regardless of the technology! SPIEL: Technology should be transformative, not a to-do list. Because, really, just about any firm can change the way your IT works. Our mission is for IT to change the way your business works. The difference is a game-changer.
50
Your User Community Columbus GA SQL Server UG
Baton Rouge SQL Server User Group BRSSUG.org
51
SQLTact.com Bios and Contact
William D Assaf, MCSE Principal Consultant, Team Lead Sparkhound Inc., Vice President, BRSSUG; SQL PASS Regional Mentor South Central Cody Gros Principal Consultant, Manager Enterprise Applications Sparkhound Inc., This presentation, including all source code and this slide deck, has been posted at my blog: SQLTact.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.