in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Dave Wollerman's SharePoint Blog

I use this blog to share information with the community plus also as a repository for reference material on unique situations that I have come across.

View Dave Wollerman's profile on LinkedIn      Sogeti Logo

SharePoint Database Growth Rates

I am not sure about everyone else, but I have seen SharePoint databases grow out of control. This happens especially when you have people install SharePoint that don't maintain or even understand SQL Server 2005. I have seen configuration databases around 12GB where 11GB+ of that is all log file.

A lot of this is because the configuration and content databases are set to a Full Recovery model by default and full backups do not automatically truncate log files. I have seen where you can set the databases to a "Simple" recovery model, but this limits the customer in case they want to do transaction log backups or log shipping.

I haven't came up with a fool proof plan as of yet, but what I have found out is that one can free up space if need be manually. After a full backup you can shrink and truncate the log file to any size you need with the following command.

dbcc shrinkfile (<LOGICAL LOG FILE NAME>,<SIZE IN MB>,truncateonly)

Also, be sure to change the growth rates on the log file. By Default they are set to 10%,Limited to 2TB. The 10% adds up quickly on transaction heavy databases such as the configuration database. I would specify a set size instead of a percentage.

Comments

 

Links (6/26/2007) « Steve’s SharePoint Stuff said:

Pingback from  Links (6/26/2007) &laquo; Steve&#8217;s SharePoint Stuff

June 26, 2007 9:02 PM
 

DAP182 said:

If running WSS 3.0, where is it that I would put in that command, considering it is not running SQL Server Embedded Edition?

October 2, 2007 8:26 AM
 

DAP182 said:

Correction:  it IS running SQL Server Embedded Edition, and not SQL 2005.

October 2, 2007 8:26 AM
 

dwollerman said:

That command is run through the SQL Management studio (query analyzer). If running the embedded edition I don't believe you can run this and you won't be able to truncate the logs. If you are running SQL Express version, there is a free download for SQL Express Management Studio that will give you the tools for running this script.

www.microsoft.com/.../details.aspx

October 2, 2007 11:18 AM
 

Scott Wichall said:

You can also do "backup log <databasename> with truncate_only" then shrink the log

January 7, 2008 4:48 AM
 

Beat said:

Many people have the problem that SQL databases grow out-of-control. Actually, it is not the database but the transaction log (the recording of all changes over time) that grow out-of-control. You don't need all those changes for the database to work perfectly, not even for recovery of old documents in sharepoint or whatever. The only reason you would like to keep the transaction logs is because you want to be able to do a point-of-time restore of your database to an earlier moment (e.g. before a database corruption took). In that case, good database backup and recovery strategy is very important and must be in place, otherwise the transaction logs are useless anyway. Therefore, if your databases grow out-of-control, change from full recovery model to simple recovery model and your problems will disappear after shrinking the transaction log. Once you understand the full recovery model and have a backup plan that includes making transaction log backups in place, you can turn full-recovery model back on and your transaction log will not grow out-of-control, because with a decent backup plan, the transaction log is stored on the backup medium and only the most recent portion is left on the server.

July 15, 2008 10:48 AM
 

Beat said:

Many people have the problem that SQL databases grow out-of-control. Actually, it is not the database but the transaction log (the recording of all changes over time) that grow out-of-control. You don't need all those changes for the database to work perfectly, not even for recovery of old documents in sharepoint or whatever. The only reason you would like to keep the transaction logs is because you want to be able to do a point-of-time restore of your database to an earlier moment (e.g. before a database corruption took). In that case, good database backup and recovery strategy is very important and must be in place, otherwise the transaction logs are useless anyway. Therefore, if your databases grow out-of-control, change from full recovery model to simple recovery model and your problems will disappear after shrinking the transaction log. Once you understand the full recovery model and have a backup plan that includes making transaction log backups in place, you can turn full-recovery model back on and your transaction log will not grow out-of-control, because with a decent backup plan, the transaction log is stored on the backup medium and only the most recent portion is left on the server.

July 15, 2008 10:48 AM
 

Gupta said:

And once they start getting that big, a crash can be a HUGE problem! Be sure to do your backups. Mine crashed about six months ago and I had to contract an outside service (datarecoveryclinic.com) to help. I was able to get everything back, but it was an intense day or two.

August 7, 2008 11:25 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts