Summary:
Recommendations -- not in order -- for optimizing SQL server for SharePoint. Best to simply read chapter 3 of English, Bill, Brian Alderman, and Mark Ferraz. "Optimizing SQL Server for SharePoint 2010." In Microsoft Sharepoint 2010 Administrator's Companion, 95-133. Redmond: Microsoft Press, 2010.
Resources:
- Hardware and software requirements: http://technet.microsoft.com/en-us/library/cc288751.aspx
- Devote SQL server only to SharePoint
- Use 64-bit edition of Microsoft SQL Server 2008 R2
- 32 GB Ram (b/c we expect > 60 GB in the content DB and >1200 users: see attached xl file for calculations)
- 4 CPU (see attached xl file for calculations)
- 64 kb NTFS unit allocation size (can increase performance by 30%... ours is currently set to 4kb on sql server)
- Set min and maximum memory of SQL server. Set min = max = (total Physical Memory - OS Memory); this effectively fixes the memory available to SQL. (Does not require a restart)
- Change default database files path (e.g., … primary data file, transaction log files). (Important: do this after installing SQL and before installing content databases) These should
- Not be on the OS
- On a RAID-10 array or
- On separate disks
- Change "Model DB Settings" (Read this article for database sizing information:Database Types and Descriptions)
- Initial size of primary data file (say, 1GB… we will need to manually modify any newly created content DBs...which means we will need a process for enabling new SP Services... this process will need to include specifications for database size, autogrowth values, and ratio of mdf to ldf files).
- Initial size of transaction log file (25% of mdf)
- Recovery model (set to Full)
- Autogrowth (set to 1GB, though this property is not inherited by newly created databases)
- Set default collation type for the instance to Latin1_General_CI_AS_KS_WS (This can alternatively be done database-by-database)
- Configure the domain accounts (As specified here: http://technet.microsoft.com/en-us/library/ee662519.aspx)
- sharepoint-sql (SQL Server service account; Domain user account; No permissions necessary… assigned during installation)
- sharepoint-setup (Domain user account; Member of the Administrators group on each server on which Setup is run… but NOT on SQL server; SQL Server login on SQL Server; Member of the following SQL Server security roles:
- securityadmin fixed server role
- dbcreator fixed server role
- sysadmin (not necessary… only if this account will be an SQL admin … per Glaser: http://andreasglaser.net/post/2009/11/18/Installing-SharePoint-Server-2010-on-Windows-Server-2008-R2-and-SQL-Server-2008-R2-Part-5-Administrative-and-service-accounts.aspx)
- Only if we run Windows PowerShell cmdlets that affect a database, will this account be a member of the db_owner fixed database role for the database
- sharepoint-farm (Domain user account; Note: additional permissions are automatically granted on setup!; Also, it's automatically added as SQL Server login on SQL Server with the following roles: dbcreator; securityadmin; db_owner (User Profile Service ultimately requires this to be a member of the local administrator's group on the server that service runs on… but does not need to be and should not be in local administrator's group on the SQL server).
- Harden SQL Server for SharePoint environments (SharePoint Foundation 2010). Instructions here: http://technet.microsoft.com/en-us/library/ff607733.aspx
- Block UDP port 1434
- Configure named instances of SQL Server to listen on a nonstandard port (other than TCP port 1433 or UDP port 1434).
- For additional security, block TCP port 1433 and reassign the port that is used by the default instance to a different port.
- Configure SQL Server client aliases on all front-end Web servers and application servers in the server farm. After you block TCP port 1433 or UDP port 1434, SQL Server client aliases are necessary on all computers that communicate with the computer running SQL Server.
- Create Content DBs.
- Either Deploy by using manually DBA-created databases (SharePoint Foundation 2010) … http://technet.microsoft.com/en-us/library/cc288606.aspx (Advantage: all model database settings – including the autogrowth – are inherited. Must check collation types, though)
- Or: Install SharePoint; let this happen automatically.
- Things to double check:
- Collation must be Latin1_General_CI_AS_KS_WS
- Recovery model set to FULL for all DBs, except tempdb, which should be "simple"
- Transaction log files:
- Size: 25% of combined data files' size
- Autogrowth: 25-50% of file's initial size
- Path: configured at SQL server instance… on RAID-10 array
- Primary Data Files:
- Initial Size: See spreadsheet
- Autogrowth: 25-50% of file's initial size
- Path: configured at SQL server instance… on RAID-10 array
- Secondary Data Files:
- Initial Size: See spreadsheet
- Autogrowth: 25-50% of file's initial size
- Path: configured at SQL server instance… on RAID-10 array
- Check the Tempdb (SP is only as fast as tempdb database)
- Fastest I/O subsystem
- Simple recovery
- RAID-10 disk
- Set initial size to something bigger (lean toward bigger)
- Set file growth size to a "reasonable size" to prevent db files from growing in small increments.
- If initial value is 1-100mb: set to 10mb
- If initial value is 100-200mb: set to 20mb
- If initial value is 200mb or more: set to 10%
References
Good article: http://technet.microsoft.com/en-us/library/hh292622.aspx
