As I was tuning a SharePoint environment today, I thought it would be a good opportunity to post a brief message about three SQL Server settings: Autogrowth, Auto Shrink, and the Shrink Database Task.
1. Autogrowth - Fixed Amount:
This setting applies to data files (.mdf) and transaction log files (.ldf). Autogrowth allows or prevents SQL Server from automatically increasing the size of the files when the need arises. In SharePoint environments, it is best to do capacity planning in advance and set the intial database sizes appropriately. Then, set the Autogrowth value for both the data files and the log files to a fixed amount. This ensures that the files grow in consistent increments. The fixed amount should be somewhat substantial, relative to the size of the database. This ensures that the growth does not occur too frequently.
2. Auto Shrink - Turn it Off:
Auto Shrink is an option that allows or prevents SQL Server from automatically reducing the size of database files. By default, the SQL Server Model database has the Auto Shrink option off. As Paul Randal points out, enabling Auto Shrink can lead to Auto-Grow, Auto-Shrink loops as well as database fragmentation, and other performance issues (Randal, 2007). As a general rule of thumb for most SharePoint environments, this option should remain off for system and content databases.
3. Shrink Database Task - Don't Schedule It:
The Shrink Database Task is an available Maintenance Plan Task. If set, this operation will reduce the size of a database according to a schedule, leaving a specified amount of free space. As with the Auto Shrink option, the Shrink Database Task leads to performance issues and is not recommend in SharePoint environments.
So, if an existing SharePoint environment does have a scheduled Shrink Database Task, then a suggested action would be to remove the Shrink Database Task and then plan to monitor and manage database size using a manual approach. When determining a plan for managing database size, it is important to keep Database Recovery Models in mind.
Reference
Randal, P. (August, 2008). Top Tips for Effective Database Maintenance. Retrieved July 30, 2010 from http://technet.microsoft.com/en-us/magazine/2008.08.database.aspx?pr=blog.
Randal, P. (March, 2007). Turn AUTO_SHRINK off!! Retrieved July 30, 2010 from http://blogs.msdn.com/b/sqlserverstorageengine/archive/2007/03/28/turn-auto-shrink-off.aspx.
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2010
(60)
-
▼
July
(10)
- Event: SharePoint Saturday Boston 2010
- Three SQL Server Settings for SharePoint Environme...
- Why Information Silos Are So Persistent
- General Business Requirements vs. Solution Require...
- SharePoint 4.0: Summary Links Data Column Type
- Site Columns: SharePoint 2010 vs. SharePoint 2007
- Fiddler
- Microsoft Certifications for SharePoint 2010
- Connected Lookup on Codeplex
- Link: Process Monitor
-
▼
July
(10)
Events / Conferences / User Groups
- AIIM Conference
- Boston Area SharePoint User Group
- Boston Azure User Group
- Collaborate
- DevConnections
- DevIntersection
- Enterprise Search Summit
- Microsoft Build
- Microsoft SharePoint Conference
- Microsoft TechEd
- New England ASP.NET Professionals User Group
- New England Oracle Applications User Group
- Oracle Applications User Group (OAUG)
- Oracle OpenWorld
- PeopleSoft Government Contractor Special Interest Group
- PeopleSoft Southern New England Users Group
- Quest International Users Group
- SharePoint Saturday
- SPTechCon
- SQL PASS
- SQL Saturday
- Startup Weekend
4 comments:
Hi,
Just a quick comment. You should never turn auto shrink on for a MS SQL server database.
That option should be called auto-fragment or auto-generate-bad-performance or better yet be removed from the product!
Auto-shrink causes database fragmentation and is NOT a good idea.
Thanks for the post.
Sean,
Please read my post again. I did not suggest anywhere to turn on autoshrink, in fact, I said just the opposite - I said to turn it off.
"this option should remain off for system and content databases"
Thanks,
Nick
Sean,
I modified the heading of each item to include a quick description.
Autogrowth - Fixed Amount
Auto Shrink - Turn It Off
Shrink Database Task - Don't Schedule It
Nick
thanks for the post, very usefull!
Post a Comment