TFS 2010 database growing too fast
-
Wednesday, October 26, 2011 10:41 PMThe Tfs_Software.mdf SQL database for our TFS 2010 server is over 500GB in less than 9 months. Is this normal? I'm IT system engineer, not software engineer. Is there long term maintenance that can be done to limit the growth. I'm having difficulty keeping up with the hardware needs.
Answers
-
Sunday, October 30, 2011 7:31 PM
Hi !
You don't tell how your system is used (build, test etc), but if you are using builds and also the test management parts, the grow in data may be caused by the diagnostic captures from these. If you're using only the build-in tools, you should check the build's retention policies, and check to make sure you're not keeping too much old data. CHeck both the number of builds you keep, and what data you delete.
You can go into the column "What to delete" and add there that it should delete Test Results too.
To clean up existing builds, you can just delete them from the build explorer.
There is also a Test Attachment Cleaner on Visual Studio Gallery which you could use:
http://visualstudiogallery.msdn.microsoft.com/3d37ce86-05f1-4165-957c-26aaa5ea1010/
You can use the tool to both delete the data or just view the size of the data. The post there has some examples of scenarios that may apply to you, for example "Identify list of attachments taking up database space of more than 1 GB per attachment"
Also, see Grant Holiday's blog post about this issue: http://blogs.msdn.com/b/granth/archive/2011/02/12/tfs2010-test-attachment-cleaner-and-why-you-should-be-using-it.aspx and Buck Hodges post about the cleaner tool http://blogs.msdn.com/b/buckh/archive/2011/03/19/managing-tfs-2010-how-to-clean-up-test-attachment-data.aspx
Terje Sandstrom [MVP]- Marked As Answer by Lily_WuMicrosoft Contingent Staff, Moderator Wednesday, November 09, 2011 3:36 AM
-
Tuesday, November 01, 2011 12:04 AM
Not sure if it was ur question mate, but certainly growing TFS db size has grabbed a lot of attention over the last few days. http://blogs.msdn.com/b/bharry/archive/2011/10/31/tfs-databases-growing-out-of-control.aspx
Please remember to mark the replies as answers if they help.Blog: http://geekswithblogs.net/TarunArora
Subscribe in a reader- Marked As Answer by Lily_WuMicrosoft Contingent Staff, Moderator Wednesday, November 09, 2011 3:37 AM
All Replies
-
Wednesday, October 26, 2011 11:25 PM
Hi,
You can always shrink the logs & database http://coderjournal.com/2009/02/tf30042-the-database-is-full-contact-your-team-foundation-server-administrator/
Also take a look at,
- http://connect.microsoft.com/VisualStudio/feedback/details/539499/tfs-database-size-growing-too-fast
Cheers, Tarun
Please remember to mark the replies as answers if they help.Blog: http://geekswithblogs.net/TarunArora
Subscribe
in a reader- Edited by Tarun__AroraMVP Wednesday, October 26, 2011 11:27 PM
-
Wednesday, October 26, 2011 11:40 PMThanks for the links (already did the db and log file shrink), but the db is actually over 500GB and it grows several GB per day. No problem with log files.
-
Friday, October 28, 2011 3:50 AMModerator
Hi whatisn'tinusealready,
Thank you for your post.
According to your description of the issue, can you help me figure out some problems to narrow down the issue.
1. Is it the Data File(s) or Log File that grows too fast?
2. What Recovery Model does the Database have?
3. How are you rebuilding the indexes (with DBCC DBREINDEX perhaps)?Best Regards,
Lily Wu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Sunday, October 30, 2011 4:18 PM
Hi Lily,
The Data File is growing several GB per day, currently 575GB in 9 months of use. The log file is not a problem since I shrink it about once a month by putting the Recovery Model to Simple, shrinking and then setting the Recovery back to Full. I use the Rebuild Index task in the maintenance plan once per week. I'm not a dba so I try not to stray from built-in tools. This system is critical to our product development group but it is scaring me since it is getting a little out of control.
Thanks,
Gary
-
Sunday, October 30, 2011 7:31 PM
Hi !
You don't tell how your system is used (build, test etc), but if you are using builds and also the test management parts, the grow in data may be caused by the diagnostic captures from these. If you're using only the build-in tools, you should check the build's retention policies, and check to make sure you're not keeping too much old data. CHeck both the number of builds you keep, and what data you delete.
You can go into the column "What to delete" and add there that it should delete Test Results too.
To clean up existing builds, you can just delete them from the build explorer.
There is also a Test Attachment Cleaner on Visual Studio Gallery which you could use:
http://visualstudiogallery.msdn.microsoft.com/3d37ce86-05f1-4165-957c-26aaa5ea1010/
You can use the tool to both delete the data or just view the size of the data. The post there has some examples of scenarios that may apply to you, for example "Identify list of attachments taking up database space of more than 1 GB per attachment"
Also, see Grant Holiday's blog post about this issue: http://blogs.msdn.com/b/granth/archive/2011/02/12/tfs2010-test-attachment-cleaner-and-why-you-should-be-using-it.aspx and Buck Hodges post about the cleaner tool http://blogs.msdn.com/b/buckh/archive/2011/03/19/managing-tfs-2010-how-to-clean-up-test-attachment-data.aspx
Terje Sandstrom [MVP]- Marked As Answer by Lily_WuMicrosoft Contingent Staff, Moderator Wednesday, November 09, 2011 3:36 AM
-
Sunday, October 30, 2011 8:11 PM
Hi, u might also benefit from this blog post => http://blogs.msdn.com/b/anutthara/archive/2011/10/30/gsjgd.aspx.
Cheers, Tarun
Please remember to mark the replies as answers if they help.Blog: http://geekswithblogs.net/TarunArora
Subscribe in a reader -
Monday, October 31, 2011 6:27 AMModerator
Hi whatisn'tinusealready,
How about the issue now?
Osiris and Tarun have shown more detail information to narrorw the issue, could these catch the issue?If anything is unclear, please free feel to let me know.
Best Regards,
Lily Wu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Tuesday, November 01, 2011 12:02 AMThanks for the replies and links to useful information. I don't manage TFS2010 so will need to work with the developers to see what we can do.
-
Tuesday, November 01, 2011 12:04 AM
Not sure if it was ur question mate, but certainly growing TFS db size has grabbed a lot of attention over the last few days. http://blogs.msdn.com/b/bharry/archive/2011/10/31/tfs-databases-growing-out-of-control.aspx
Please remember to mark the replies as answers if they help.Blog: http://geekswithblogs.net/TarunArora
Subscribe in a reader- Marked As Answer by Lily_WuMicrosoft Contingent Staff, Moderator Wednesday, November 09, 2011 3:37 AM
-
Monday, November 07, 2011 8:52 AMModerator
Hi Gary,
How about the issue now?
If anything is unclear, please free feel to let me know.
Best Regards,
Lily Wu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Tuesday, November 15, 2011 1:59 PM
Hi again !
Just added a blog post with a guide on how to handle cleaning out test attachments and also the binary files, both as a "Once" job and as a scheduled maintenance. The guide also contains a section on how to investigate the database to see what is taking up the space.
Terje Sandstrom [MVP]
