What SQL DBAs need to know about SharePoint


Published on

Published in: Technology
  • Be the first to comment

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

No notes for slide
  • LPiM = Lock Pages in Memory
  • LPiM = Lock Pages in Memory
  • What SQL DBAs need to know about SharePoint

    1. 1. What SQL DBAs need to know about SharePoint<br />JD Wade, MCITP<br />SharePoint Consultant<br />Horizons Consulting<br />Twitter: http://twitter.com/jdwade<br />Blog: http://wadingthrough.com<br />
    2. 2. Why, oh why, oh why?<br />
    3. 3. Single Platform – Power and Challenge!<br />Corporate<br />Web<br />Presence<br />Single Business Productivity Platform leading to common:<br /><ul><li> End-user Experience
    4. 4. Rich Integrated Capabilities
    5. 5. Toolset and Development
    6. 6. Deployment and Management</li></ul>Employee<br />Portal<br />Knowledge<br />Management<br />Portal<br />Regulatory<br />Compliance<br />Repository<br />Users<br />Sales<br />Division<br />Portal<br />Custom<br />SAP<br />Front-End<br />Business<br />Intelligence<br />Dashboard<br />R&D<br />Community<br />Geneva<br />Office<br />Site<br />Extranet<br />Collab<br />Site<br />Team “ABC”<br />Site<br />Project<br />“X” Site<br />Weekly <br />Issue<br />Tracking<br />Meeting<br />Corporate<br />Teams<br />Departments<br />Empowerment<br />
    7. 7. SQL ImplementationCommonly Perceived Gaps<br />SharePoint tables are too wide, wraps rows<br />SharePoint manages its own (NVP) indexes<br />SharePoint adds force-order, query hints<br />Missing indexes for common operations<br />Excessive use of Dynamic queries<br />No SQL Referential Integrity OR key constraints<br />DBCC with data loss not supported<br />Missing integration of Back-up/Restore<br />
    8. 8. Why are DB Changes Not Supported?<br />Single data platform for all workloads<br />Workloads with conflicting platform needs<br />Change for one may adversely affect another<br />Upgrade and Servicing expects solid DB contract<br />App logic is heavily dependent on DB specifics<br />App enforces constraints and integrity!<br /><ul><li>Mostly Read
    9. 9. Article Pages
    10. 10. Search and structured queries</li></ul>Corp<br />Web<br />Presence<br />Users<br /><ul><li>Read Writes
    11. 11. Office Documents
    12. 12. Organization and ad-hoc queries</li></ul>Team <br />Collab Site<br />Empowerment<br />
    13. 13. Storage<br />
    14. 14. Storage5 Key Points to Consider<br />…<br />App Server<br />App Server<br />App Server<br />SQL Server<br />1<br />HBA<br />HBA<br />2<br />3<br />4<br />5<br />tempdb tempdb T-log<br />DB T-logs<br />Content DBs<br />Search DB<br />
    15. 15. StorageOptimizing SQL Server I/O Subsystem<br />Ensure correct HBA driver and firmware versions<br />Use SQLIO.exe to measure I/O performance<br />Configure correct NTFS Allocation Unit Size<br />64K best; default (4K) can result in a 30% perf hit<br />To view: chkdsk <drive_letter><br />Ensure correct Windows “Sector Alignment”<br />Incorrect setting can result in up to 50% perf hit<br />Use diskpart to check and set alignment<br />64K most common. Windows 2008 aligns sectors by default<br />Free space on NTFS partition should be > 25%<br />
    16. 16. StorageDatabase Configuration<br />Recommended database file placement <br /> priority (fastest to slowest drive)<br />tempdb data and t-log files<br />Db transaction log files<br />Search db data files<br />Content db data files<br />In a heavily read-oriented portal site, prioritize data over logs.<br />Place tempdb, Content db and t-logs on separate LUNs<br />Use multiple data files for Content and Search dbs<br />Distribute equi-sized data files across separate disks<br /># of data files should be <= # of processor cores<br />Multiple data files are not supported for other dbs<br />Place SharePoint Search crawl and query processing tables on separate spindles<br />
    17. 17. StorageDatabase Sizing<br />Site Collections > 15GB, use SQL Backups<br />Limit Content DBs to 100 GB (soft limit)<br />If larger consider differential backups using<br /> SQL or DPM<br />Size SQL Server data files appropriately<br />Pre-allocate data file to cover anticipated size of Content db<br />Rely on SQL ‘Autogrow’ only as a catastrophic insurance policy<br />Set SQL ‘Autogrow’ to fixed value appropriate for size of db<br />Use dedicated database for large Site Collections (> 50GB)<br />Configure tempdb data files = No of proc cores<br />Configure tempdb to be at least 10% (25% preferred) of total Content db size, or the size of the largest table - whichever is greater<br />
    18. 18. Configuration<br />
    19. 19. ConfigurationTypical Deployment Sizes<br />
    20. 20. ConfigurationRecommended Capacities<br />
    21. 21. ConfigurationProcessors<br />Deploy on 64-bit, especially if >1000 users, or >100 GB of data<br />Use 64-bit SQL Server if using 64-bit OS<br />IA-64 only supported on db tier, not on app tier<br />
    22. 22. Configuration Memory<br />Set ‘Max Server Memory’<br />SQL Max Memory = TotalPhyMem<br /> - (NumOfSQLThreads * ThreadStackSize)<br /> - (1GB * CEILING(NumOfCores/4))<br /> - (Any mem required for ‘other’ apps)<br /> NumOfSQLThreads = 256 + (NumOfProcessors*- 4) * 8 <br /> ThreadStackSize = 1 MB on x86<br /> 2 MB on 64-bit (x64)<br /> 4 MB on 64-bit (IA64)<br />On 64-bit use LPiM privilege for SQL Server account<br />If using SQL Std edition need following CU + trace flag<br />CU2 for SQL Server 2008 SP1 (KBA 970315)<br />CU4 for SQL Server 2005 SP3 (KBA 970279)<br />* If NumOfProcessors > 4, else 0.<br />
    23. 23. Configuration<br />Use SQL Server connection alias<br />Simplifies redirecting WFEs to a different dbinstance<br />Do not modify SPT schema<br />No new columns or<br /> indexes permitted<br />Use SharePoint tools<br /> to index columns<br />
    24. 24. Configuration<br />Test use of MAXDOP = 1<br />Separate instance for SharePoint Databases<br />Set Fill Factor to 70<br />SharePoint ignores Model Autogrow settings<br />
    25. 25. Maintenance<br />
    26. 26. Maintenance<br />Monitor SQL Server performance regularly<br />Check integrity of the database routinely<br />DBCC CHECKDB<br />Can use REPAIR_REBUILD option to fix errors (not always possible)<br />REPAIR_ALLOW_DATA_LOSS not supported<br />Time consuming operation, run during non-peak hours<br />For very large DBs consider using option MAXDOP=1<br />Defragment physical files<br />Maintain farm account as DBO for moves/restores<br />
    27. 27. MaintenanceFragmentation<br />Content and Search dbs most susceptible<br />Rebuild / Reorganize indexes to eliminate fragmentation<br />Reorganize index when fragmentation between 10-70%<br />Rebuild index when fragmentation > 70%<br />Existing index options used before the rebuild operation are not restored. Issue resolved in SQL Server 2005 SP2 and higher<br />Use sys.dm_db_index_physical_stats to measure<br />More accurate than DBCC SHOWCONTIG, often reports higher fragmentation numbers<br />Auto-defrag only available in MOSS 2007 SP2 and for Content dbs but may need manual defragmentation<br />Database Maintenance for SharePoint white paper<br />
    28. 28. MaintenanceShrinking Database Size<br />Only shrink Content databases, not others<br />Only perform if free space > 50% (after content reorg)<br />Do not perform as part of maintenance plan<br />Allocate 10-20% growth allowance when determining target size<br />
    29. 29. High Availability<br />High availability options supported:<br />Failover Clustering (local & stretch clusters)<br />Database mirroring (Sync & Async)<br />Log Shipping often used in conjunction to provide disaster recovery<br />
    30. 30. High AvailabilityDatabase Mirroring Configurations<br />DB Mirroring within farm<br />(Synchronous)<br />DB Mirroring across farms<br />(Asynchronous)<br />
    31. 31. High AvailabilityDatabase Mirroring<br />Needs to be individually configured for each SPT db<br />Requires Full Recovery model<br />Both Synchronous and Asynchronous modes supported<br />Synchronous DBM mode with witness server recommended for high availability<br />Transfer SPT logins from Primary to Mirror server<br />Script available in KBA 918992<br />DB Mirroring SQL end-points should be encrypted when channel is not secured by other means<br />
    32. 32. High AvailabilityDatabase Mirroring<br />Only supported on SQL Server Standard and Enterprise editions<br />Standard edition only supports Synchronous mirroring<br />On Standard edition 1 redo thread per db; on enterprise edition 1 redo thread per db per 4 cores<br />Witness server can run on SQL Express<br />Several improvements in SQL Server 2008 DBM<br />Log stream compression<br />Automatic Page Repair<br />Pending send buffers limit increased from 3 to 64 <br />
    33. 33. High AvailabilityAsynchronous Mirroring<br />Asynchronous DBM can be used to provide redundancy for Content dbs across farms<br />Does not guarantee consistency<br />DBs that cannot be Async mirrored<br />Configuration & Central Admin Content dbs<br />Contain location specific references, must be rebuild at mirror site<br />SSP dbs only if using Search<br />Search requires sync between SSP dbs, Search db, and index (index file cannot be mirrored)<br />
    34. 34. Upcoming Attractions<br />
    35. 35. SQL 2008 R2SharePoint Integration<br />Improved Reporting Services in SharePoint integrated mode<br />Easier install<br />Extract data from SharePoint 2007 or 2010 lists<br />SSRS is reporting engine for SharePoint Access Services reporting<br />PowerPivot for SharePoint<br />“SSAS in SharePoint integrated mode”<br />
    36. 36. SharePoint 2010<br />Support for RBS using SQL Filestream<br />Restore items directly from SQL database<br />AvePoint add-on<br />Support for SQL Mirroring built-in<br />Access Services<br />PerformancePoint built-in<br />
    37. 37. Q & A<br />
    38. 38. Sources<br />Primary slide content with modifications from:<br />SharePoint Conference 2009SPC319: SQL Server Best Practices for SharePoint Deployments<br />BurzinPatel, Senior Program ManagerMicrosoft Corporation<br />Database Maintenance for SharePoint white paperhttp://technet.microsoft.com/en-us/library/cc262731.aspx<br />