SQL Server for SharePoint geeks


Published on

Community Day Belgium 2012

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

SQL Server for SharePoint geeks

  1. 1. #comdaybe SQL Server for SharePoint geeks and other involuntary DBA’s Thomas Vochten
  2. 2. About me
  3. 3. What we’ll cover1. SharePoint & SQL Server2. Setup & planning primer3. Configuration tips4. Maintenance tips5. Common problems
  4. 4. Disclaimer• Focus on SharePoint• It depends
  5. 5. Who needs a DBA anyway? Who manages a production SQL Server without being a “real” DBA? Meet the involuntary / accidental DBA
  6. 6. 1/ SharePoint & SQL ServerThe dynamic duo
  7. 7. Importance to SharePoint• SharePoint performance impact• Everything is stored in SQL• Crucial for your HA/DR strategy• A lot of databases
  8. 8. Limits & boundariesContent database sizingSP 2007 100 GBSP 2010 pre SP1 200 GBSP 2010 post 200 GB or moreSP1
  9. 9. Software requirements• Products supported: SQL 2005, 2008, 2008 R2 or 2012• Editions supported: Express, Standard, Enterprise• SQL 2012 support after SP 2010 SP1
  10. 10. SharePoint makes DBA’s cry• GUIDS all over the place• “Don’t touch” support policy
  11. 11. Getting rid of the GUIDgrey wizard = good white wizard =bad
  12. 12. PowerShell to the rescue!• New-SPConfigurationDatabase• AutoSPInstaller• Naming convention mattershttp://autospinstaller.codeplex.com
  13. 13. Before you start• KB841057 (support policy)• One whitepaper to rule them all
  14. 14. 2/ Setup & planning primerStart it up!
  15. 15. General considerations• SQL is all about disk/mem/cpu• Dedicate a SQL instance to SharePoint• Virtualizing SQL Server
  16. 16. Plan your disksDifferentiate & prioritize based on IO needs1. tempdb2. logs3. search4. other databases
  17. 17. Prepare your disksCheck/modify:Partition alignment 1024K everywhereAllocation unit size 64K for SQL data & logsUp to 50% io performance gains measured!
  18. 18. Prepare your disksdiskpartlist diskselect disk <DiskNumber>create partition primary align=1024assign letter=<DriveLetter>format fs=ntfs unit=64K label="<label>" nowait
  19. 19. Prepare your disks• Test the disks you get offered• Sqlio to the rescue (or even CrystalDiskMark)
  20. 20. Prepare your disks setup & planning primerdemo
  21. 21. Running setup• Only install the features you need• Use domain user as service account• Don’t lock out other admins• Configure data & logfile placement
  22. 22. 3/ Configuration tipsMake it work
  23. 23. Post setupEnable instant file initialization• Speeds up data file creation enormously• Does not work for log files• “Perform volume maintenance tasks”
  24. 24. Instant file initialization Configuration tipsdemo
  25. 25. Don’t forget• Start SQL Server Agent• Set up alerting for specific events• Don’t forget about Windows Firewall (open port 1433)
  26. 26. SQL Server Agent Configuration tipsdemo
  27. 27. Instance level settings• Maximum memory• Fill factor (80)• Backup compression (On)• MAXDOP (1)
  28. 28. Instance level settings Configuration tipsdemo
  29. 29. Database level settings• Consider multiple data files• Tune autogrowth settings• Presize databases• Recovery model (simple or full)• Read-only databases
  30. 30. Database level settings Configuration tipsdemo
  31. 31. Connecting SharePoint to SQL• Use SQL aliases for added flexibility• Test your connection beforehand• Grant the correct rights to the setup account (dbcreator, securityadmin)
  32. 32. SQL aliases Configuration tipsdemo
  33. 33. 4/ Maintenance tipsKeeping it running
  34. 34. Regular maintenance• Check database integrity (dbcc checkdb)• Check index fragmentation & rebuild if needed (30% for content databases)• Learn about maintenance plans
  35. 35. Index fragmentation Check “sys.dm_db_index_physical_stats” Illustration by Paul Randal
  36. 36. Reducing fragmentation• Run Health Analyzer rules• Perform operations manually• Set the fill factor to 80
  37. 37. SharePoint health analyzer rules• Index defragmentation• Statistics maintenance configuration database content databases user profile database user profile social database web analytics reporting database web analytics staging database word automation database
  38. 38. Watch out for the shrink Just because you can, doesn’t mean you should• Causes massive fragmentation• Autoshrink is the root of all evil!
  39. 39. Database maintenance Maintenance tipsdemo
  40. 40. 5/ Common problems#sqlhelp
  41. 41. Simple or full “Why does this log file grow forever?” Know the recovery models and their influence on disk space and backups
  42. 42. Controlling log file size Common problemsdemo
  43. 43. Counter intelligence• Blitz! scripts by Brent Ozar• Diagnostic scripts by Glenn Berry• PAL Tool
  44. 44. 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/rankingsGet help – fast!#sqlhelp on Twitter
  45. 45. Q&A
  46. 46. SQL Server for SharePoint geeksThank you!
  47. 47. What about RBS? Just because you can, doesn’t mean you should Pro• Potentially cheaper storage• Move-SPSite (after SP1)• Disk I/O optimizations Cons• Backup / restore complexity• Not supported together with mirroring• General operational burden• 3rd party software
  48. 48. A case for RBS• Heavily focused on document libraries• The vast majority ( >70%) of those files exceed 1MB in size.• The SharePoint content databases holding these files are relatively large ( >200GB) now or in the immediately foreseeable future• You have Disaster Recovery tools that are either directly RBS aware, or have processes designed to synchronize backups• You have highly skilled, expert SQL and Windows administration staff that is currently or has the capacity and directive to be well trained in RBS use, administration, and troubleshooting [Source: Chris Mullendore, MSFT PFE]