DX Infrastructure Management

Expand all | Collapse all

How do you clean up unneeded templates in MCS?

Jump to Best Answer
  • 1.  How do you clean up unneeded templates in MCS?

    Posted 02-15-2019 10:07 AM

    I have some templates for MCS that fail to apply. Deleting them from the processed folder directly would be easy enough, but they still exist in ssrv2template and are listed when doing a list_template versions.

     

    How can I safely clean up and remove templates that are no longer needed?



  • 2.  Re: How do you clean up unneeded templates in MCS?

    Posted 02-18-2019 03:18 PM

    I just know how to do a Full clean/reset:

     

    How to reset MCS monitoring - CA Knowledge 



  • 3.  Re: How do you clean up unneeded templates in MCS?
    Best Answer

    Posted 02-20-2019 01:00 AM

    Dan -

     

    As provided by development the following SQL queries can be used to delete unwanted MCS templates from the MCS tables in the UIM database:

     

     

    declare @PROBE varchar(20);
    set @PROBE = 'probename';
    declare @VERSION varchar(20);
    set @VERSION = 'x.xx';
    delete from SSRV2PackageTemplate where template in (select templateid from ssrv2template where probe = @PROBE and version=@VERSION);
    delete from ssrv2container where template in (select templateid from ssrv2template where probe = @PROBE and version=@VERSION);
    delete from ssrv2removal where template in (select templateid from ssrv2template where probe = @PROBE and version=@VERSION);
    delete from ssrv2configvalue where field in (select id from ssrv2field where template in (select templateid from ssrv2template where probe = @PROBE and version=@VERSION));
    delete from ssrv2field where template in (select templateid from ssrv2template where probe = @PROBE and version=@VERSION);
    delete from ssrv2profile where template in (select templateid from ssrv2template where probe = @PROBE and version=@VERSION);
    delete from ssrv2template where templateid in (select templateid from ssrv2template where probe = @PROBE and version=@VERSION);