21. Brent Ozar’s “First Responder Kit”
sp_Blitz
How am I doing?
sp_BlitzFirst
Where’s the bottleneck?
sp_BlitzBackups
How far back can I go?
Great collection of free diagnostic SQL Scripts
https://www.brentozar.com/responder/
22. Brent Ozar’s First Responder Kit
Leverage the power of the SQL community
DEMO
23. Ola Hallengren’s “Maintenance Solution”
Backups
Consistency
checks
Index
Maintenance
Free, tried & true scripts with ready-to-schedule jobs
https://ola.hallengren.com/
The industry standard. Period. Time to stop creating Maintenance Plans.
28. dbatools to the rescue
Leverage the power of the SQL community
DEMO
29. Glenn Berry’s “Diagnostic Scripts”
Free SQL Scripts available for every SQL Server release
http://sqlserverperformance.wordpress.com
If you need to dig in deeper…
34. Importance to SharePoint
• SharePoint performance impact
• Almost everything is stored in SQL
• Contributes to your HA/DR strategy
35. SharePoint makes DBA’s cry
• The support policies
• The strange schema
• The database settings
• The default database names
• The server rights we ask for
• The unconventional maintenance practices
• SharePoint likes to create its databases all by itself
• …
36. More frustrations…
• Auto Create Statistics = off
• Auto Update Statistics = off
• GUIDS as clustered indexes
• No real referential integrity
• Model Database is not used by SharePoint
consistently
37. Don’t
• Adding database triggers
• Adding new indexes or changing existing indexes within tables
• Adding, changing, or deleting any primary or foreign key relationships
• Changing or deleting existing stored procedures
• Calling existing stored procedures directly
• Adding new stored procedures
• Adding, changing, or deleting any data in any table of any of the databases
• Adding, changing, or deleting any columns in any table
• Making any modification to the database schema
• Adding tables to any of the databases
• Changing the database collation
• Running DBCC_CHECKDB WITH REPAIR_ALLOW_DATA_LOSS
• Enabling SQL Server change data capture (CDC)
• Enabling SQL Server transactional replication
• Enabling SQL Server merge replication
38. Do
• Use the GUI
• Use PowerShell
• Use the API’s
45. 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 restore
49. Reducing fragmentation
• SharePoint Health Analyzer
• Perform index maintenance manually (Ola Hallengren)
Consider rebuilding indexes when fragmented
over 30% (for content databases)
50. Only shrink files when needed
Just because you can, doesn’t mean you should
• Causes massive fragmentation
• Autoshrink is the root of all evil!
• Rebuild indexes & keep free space
Can be considered after special SharePoint operations like moving a site
from one database to another
53. General considerations
• SQL is all about mem/disk IO/cpu
• Dedicate a SQL instance to SharePoint
• Go ahead and virtualize – if you know what you’re doing
55. Prepare your disks
Check/modify:
Up to 50% io performance gains measured!
Partition alignment 1024K everywhere
Allocation unit size 64K for SQL data & logs
60. Post setup
Enable instant file initialization
From SQL 2016 on, you can do this during setup
• Speeds up data file operations enormously
• Disables zeroing out data files
• Does not work for log files
• Set “Perform volume maintenance tasks”
https://msdn.microsoft.com/en-us/library/ms175935.aspx
66. Database level settings
• Consider multiple data files
• Tune autogrowth settings (no %)
• Presize databases
• Don’t forget TempDB!
From SQL 2016 on, you can do this during setup
67. SQL Aliases
• Use SQL Aliases to connect SharePoint to SQL Server
• Use multiple aliases for different database types:
core farm databases
content databases
search databases
logging database
68. Resources
Best practices for SQL Server in a SharePoint Server farm
https://docs.microsoft.com/en-us/SharePoint/administration/best-practices-for-sql-server-in-a-sharepoint-server-farm
Storage and SQL Server capacity planning and configuration for SharePoint Server
https://docs.microsoft.com/en-us/SharePoint/administration/storage-and-sql-server-capacity-planning-and-configuration
Overview of SQL Server in SharePoint Server 2016 and 2019 environments
https://docs.microsoft.com/en-us/sharepoint/administration/overview-of-sql-server-in-sharepoint-server-2016-and-2019-environments
Support for changes to the databases that are used by SharePoint
http://support.microsoft.com/kb/841057
Database maintenance for SharePoint
https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-server-2010/cc262731(v=office.14)
Supported high availability and disaster recovery options for SharePoint databases
https://docs.microsoft.com/en-us/SharePoint/administration/supported-high-availability-and-disaster-recovery-options-for-sharepoint-databas
69. Key Takeaways
• Leverage the power of free community tools
• Backups, backups, backups (and restores)
• Learn about what is supported and what not
• Understand how logging & recovery works
• Don’t shrink unless you know what you’re doing
• Learn about fundamental instance & database level settings