Unregistering Custom Data Collector From TFS

June 2, 2013

tags: , ,
no comments

A custom data collector for automated tests was deployed successfully at a customer site. However when we’ve tried to replace it in MTM, old versions persisted in the database. The following procedure was used to unregister the stale data collectors.

  1. Get all data collectors from tbl_DataCollector:

    SELECT * FROM [Tfs_DefaultCollection].[dbo].[tbl_DataCollector]

  2. Execute the stored procedure prc_UnregisterDataCollector with parameters:

    @partitionId: the partitionId as appears in the results  (usually is 1)

    @typeUri: the URI of the data collector you want to unregister, as appears in the results given by running the previous step.

    For example, the following script unregisters the custom data collector MyLogsCollector:

    USE [Tfs_DefaultCollection]
    GO
    DECLARE @return_value int
    EXEC @return_value = [dbo].[prc_UnregisterDataCollector]
    @partitionId = 1,
    @typeUri = N'datacollector://MyCompany/MyLogsCollector/1.0'
    SELECT 'Return Value' = @return_value
    GO

Or using SQL Management Studio:

  1. Expand Databases, expand the collection (e.g.: ‘tfs_DefaultCollection’) database, and then expand Programmability.
  2. Right click on prc_UnregisterDataCollector and select Execute Stored Procedure.

    prc_UnregisterDataCollector_exec

  3. Enter values for @partitionId and @typeUri from the results in the first step above.
    prc_UnregisterDataCollector_params
  4. Click OK. The return value should indicate 0 for successful execution.

    prc_UnregisterDataCollector_result

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*