Introduction
Some customers have reported that some VMware metrics tables get left behind, but there is some confusion about the suffix at the end of the table name. Some people are aware the suffix typically is based on a row in COND, but in the case of VMware metrics tables (start with CONV), they are based off object ids, i.e. the VM or Host ID. So, these are not really orphans and the query below would ignore them. However, I have heard of this problem happening, so here is a script to identify the orhpaned tables. Run this against the Ignite repository (may have to change the name of repository database below before running).
SQL Script
use ignite_repository
select table_name from (
select table_name, reverse(substring(reverse(table_name), 1, charindex('_', reverse(table_name))-1)) dbid
from INFORMATION_SCHEMA.TABLES
where isnumeric(substring(reverse(table_name), 1, 1)) = 1) l
where dbid not in (select id from cond)
and table_name not like 'CON_SAMPLE_SUM%'
and table_name not like 'CONV%'