SBS 2008 / 2011 Disk Space Eaten Up By SharePoint SQL Log Files – How To Reduce The Log File Size

Having been asked to look at an SBS 2008 server with a 74gb C: drive partition that was regularly running out of space (4.5Gb left when I checked this morning) and after freeing up whatever I could using the usual methods of disabling WSUS log files and clearing out old logs etc using the following article:

I decided to see if there was something more that I could do that was slightly more permanent.

I downloaded Windirstat from Sourceforge and installed it onto the server and let it scan the C: drive of the server.

When it had finished scanning, I noticed that by far and above the largest amount of data on the C: drive was being eaten up by the Sharepoint Config SQL Database Log File – amounting to about 24Gb of disk space!  What the heck?

A quick poke around the internet landed me on the following link:

Which allowed me to reduce the overall log files size to about 500Mb and the C: drive of the server now has a more satisfactory 27.9Gb of free space and is no longer sending me errors about the disk space running low, which is always welcome.

One slight issue I had when trying to look at the properties of the Database to change the Recovery Model to Simple was a lack of permissions and an error, but a quick search again landed me on this page:

Now I am by no means an SQL Guru, but I managed to work out how to change the Database Owner from NULL to SA by right-clicking on the Sharepoint_Config…………….. Database and choosing New Query.  Then just type sp_changedbowner ‘sa’ and press F5 to execute the command and bingo, the database owner has been changed and you can now look at the Database properties without seeing an error and thus you can complete the shrinking of the Log Files.

Hope that this frees up tons of space for you too.