Optimizing SQL Server 2012 for SharePoint 2013
About the Speaker
• Brian Alderman (MCT / Consultant)
• CBT Nuggets – (www.cbtnuggets.com) @cbtnuggets
• www.microtechpoint.com – Brian’s Blog
• @brianalderman
• Co-Author SharePoint 2010 Administrator’s Companion
• Co-Author SharePoint 2013 Administration Inside Out
• Enjoy Travel and Golf
Mulletville, Vermont
Garden of the Gods with Pikes Peak
Arizona Golf
19th Hole
SQL Server IntroductionSharePoint and SQL Server IntegrationDemo: SQL Server Configurations to Optimize SharePoint
SQL Server Instance ConfigurationsDatabase Configurations
Avoiding Ginormous Transaction LogsSQL Server Best Practices for Optimizing SharePoint
Session Agenda
SQL Server Introduction
Multiple Instances of SQL Server on One ServerOne Default Instance with Multiple Name InstancesEach Instance Managed Individually
Share SQL Server Management ToolsEach Instance Shares Windows Server ResourcesTwo Types of Databases: System and UserMinimum of Two Files Created Per Database
MDF (Master Data File) LDF (Transaction Log File)NDF (Optional for Extending Database)
SQL Server Introduction
SQL Server Transaction Log Process
Modification is sent byapplication to SQL Server
1
Data pages are located in, or read into the buffer cache and then modified
2
Buffer
Cache
Modification is recorded in transaction log on disk3
Later, checkpoint writesdirty pages to database4
Working with Recovery Models
Recovery Model Description
Simple Does NOT permit transaction log (t-log)
backups. Automatically truncates log to
reduce space requirements
Full Requires LOG BACKUPS to manage t-log
space requirements. Avoids data loss if
damaged or missing database file occurs.
Permits point-in-time recovery.
Bulk Logged Requires log backups to manage t-log
space requirements. Improves
performance during bulk copy
operations. Reduces t-log space usage by
using minimal logging of operations.
Master Configuration Database of SQL Server Instance
MsdbStorage of SQL Server Automation Configuration Information
Resource (Hidden)Read-Only Database Containing All SQL Server System Objects
TempdbTemporary Work Storage Area
ModelTemplate Used to Create All New Databases
SQL Server Instance Databases
SharePoint and SQL ServerIntegration
All SQL Server Versions and SharePoint VersionsLarge Majority of SharePoint Data Stored in SQL ServerFarm Configuration Information Stored in SharePoint Configuration Database in SQL ServerCentral Administration Content Stored in Own Content Database in SQL Server (Blog on how to rename)Every Web Application Minimum of One Content Database Most Service Applications Have at Least One Database
SharePoint and SQL Server Integration
SharePoint Farm Creates Several Databases (20 DB’s if Spousal Installation and Run Configuration Wizard) Content Database Contains Several Site CollectionsSite Collection Resides in Only One Content DatabaseUse Full Recovery Model on Production DatabasesControl Size of Database (Recommended 200GB)
Site Collection Quota Templates Maximum Number of Site Collections per Database
SharePoint Content Databases
Web Application200GB 200GB 200GB 200GB
Site Collections Site Collections Site Collections Site Collections
ProjectSites
DepartmentSites
HRSites
MarketingSites
750mb X 250 = 187,500mb / 1024 = 183gb
250 250 250 250
Default File Locations (Move off C:\ Drive)Minimum and Maximum Memory SettingsMax Degree of Parallelism (MAXDOP) Set to 1 Have DBA Create Alias for SharePoint SQL InstanceSharePoint Collation – Latin1_General_CI_AS_KS_WS
During Installation of SQL Server Hosting SharePoint ContentDuring Creation of Content Database in SQL Server
SQL Server Instance Configuration
Model Database File SettingsIncrease Initial Size of Data and Log FilesIncrease Autogrowth Settings (Use MB not %)
Tempdb Database File Settings Increase Initial Size of Data and Log FilesIncrease Autogrowth Settings (Use MB not %) Use Simple Recovery Model Place Files on Different Drive from Content Databases
SQL Server Database Configuration
Demo
SQL Server Configurations
Avoiding Ginormous Transaction Logs
Simple Recovery Model
Data pages are located in, or read into, the buffer cache and then modified
2
Modification is sent byapplication to SQL Server
1
Modification is recorded in transaction log on disk3
Later, checkpoint writesdirty pages to databaseand FLUSHES transactions from T-log.
4
BufferCache
Full Recovery Model
Data pages are located in, or read into, the buffer cache and then modified
2
Modification is sent byapplication to SQL Server
1
Modification is recorded in transaction log on disk3
Later, checkpoint writesdirty pages to databasebut RETAINS transactions in T-log.
4
BufferCache
mdf ldf
Sunday
Full Backup
mdf ldf
Tuesday
Differential
mdf ldf
Differential
Monday
mdf ldf
Differential
Wednesday
You Lose mdf file of database on Thursday at 4:00pm
(1) BACKUP LOG DB_Name TO D:\SQLBackups\TempBackup.Bak WITH NORECOVERY
(2) (3)
(4) RESTORE LOG FROM D:\SQLBackups\TempBackup.Bak
BACKUP LOG DB_Name TO D:\SQLBackups\Weekly_T_Log.Bak WITH INIT
Best Practices for OptimizingSharePoint
Dedicated SQL Server Instance / ServerNo Spousal Installations of SQL Server or SharePointDatabase Size Should Not Exceed 200GBMax Degree of Parallelism (MAXDOP) Set to 1Modify Model System Database Settings Avoid Auto-Shrinking DatabasesUse Database Autogrowth Sparingly
Reduces FragmentationImproves Data Entry Performance
Best Practices for SharePoint’s SQL Server
Spread Data Files and Transaction Log Files Across Multiple Drives or Locate them on RAID 5/10Create Multiple Tempdb Files on Multiple DrivesGenerate Database Maintenance PlansDefragment Drives Containing Content Database FilesPerform Regular Backups of Database and T-LogsPerform DBCC CHECKDB Operations RegularlyJust Say NO to Simple Recovery Model
Best Practices for SharePoint’s SQL Server
Thank You for Attending
Top Related