Cleaning the VS 2010 Load Test Repository DB

While working on another issue, my customer realized the the VS 2010 load test respository was full and he could no longer run load tests.  There had been some crashes and it appears that there were orphaned entries in the repository.  This can be a huge problem if your repository is using SQL Server Express Edition since there is a limit on the size of a single database.

To clean up the loadTestDB, you need to query the list of load test runs via

Select * from LoadTestRun

on the LoadTestDB.  The you can use the stored procedure Prc_DeleteLoadTestRun and pass it the appropriate LoadtestRunId as a parameter to delete the run data.

While you are in there, you probably will want to set the LoadTestDB recovery model to Simple.  Setting the recovery model to Simple will save space and increase speed.  Steps for how to do this are documented here: https://blogs.msdn.com/b/mahipalkante/archive/2010/06/10/vs-2010-load-test-results-database-recovery-model.aspx

Comments

  • Anonymous
    March 05, 2012
    When I run the stored procedure (Prc_DeleteLoadTestRun) it executes successfully, but for some reason I don't see the change in the size of LoadTest2010.mdf file. Any other jobs to run?

  • Anonymous
    March 05, 2012
    While this will remove the test data, it will not remove the unused pages from your database.  You need to shrink your database using one of the methods discussed here:   msdn.microsoft.com/.../ms189080.aspx

  • Anonymous
    March 06, 2012
    Thanks, that worked. Basically, I had to change database property settings to Auto Shrink = True and change initial database size to smaller.

  • Anonymous
    April 16, 2015
    Thanks a lot, it worked.