Canarys | IT Services

Blogs

To recover the space occupied by TFS 2010, after deleting the artifacts.

,
Share

When you delete the team project or project artifacts from TFS 2010, the TFS collection database won’t release the space occupied to store those artifacts. Even when you shrink the database file, you won’t see any change in the TPC database (.mdf) file size.

To recover the space, follow the below steps (Please wait for couple of hours to execute this command after you deleted the artifacts):

  1. Delete the team project/project artifacts.
  2. Rebuild the index on the TPC database log file using “DBCC DBREINDEX” command. This command need to be executed for each table in the database. Use a SQL cursor to execute this for all the tables in database.

    dbcc dbreindex (‘tfs_defaultcollection.dbo.Actions’)

  3. Execute the “DBCC SHRINKFILE” command on TPC database log file (.ldf) and then on data file (.mdf).

    dbcc shrinkfile (‘Tfs_DefaultCollection_log’)

    dbcc shrinkfile (‘ Tfs_DefaultCollection ‘)

  4. Now check your TPC database size, it should have reduced.

Leave a Reply

Your email address will not be published. Required fields are marked *

Reach Us

With Canarys,
Let’s Plan. Grow. Strive. Succeed.