Is there anyway to force remove all the niscache entries from UIM database ?
I know this step that can help you:
How to Clean Niscache Folder on All Active Robots
The above KB will not help to remove the entry from database. Need to remove the entry from DB.
We need to remove device entries in order to remove CI (Configuration Items) and MET (Metrics) entries existing in UIM database, because device entry is owner of these assets.
If device is removed from UIM database, its assets also removed.
Can u please share some sample query to do the whole deletion ,niscache,CI and metrics. And there is any plans to flush the niscache by robot itself?
I would do this in 2 parts. I would also like to add only do this if you are very familiar with the UIM DB. If you delete something from S_QOS_DATA it will cascade and remove all RN/HN/DN data. Use at your own risk.
Part 1 - Set ci_metric_ids to null for a specific robot:
This is assuming that you already know how to clear nis cache folder of the robot in question. After running the query below, bounce discovery_server and data_engine. Depending how many devices you have in your environment, you might have to wait 5 minutes or 30+ minutes before the ci_metric_id column is populated. Run query below:
Update s_qos_data set ci_metric_id = NULL
Where robot = '<robotname>'
Part 2 - Delete NULL entries:
After sufficient time has passed you can probably assume that any existing NULL entry probably does not exist anymore. It could also mean that a device is down and since it can not be polled it can not create a new ci_metric_id. So use your best judgement. Run the following query to delete NULL rows:
delete from S_QOS_DATA
where robot = '<robotname>'
and ci_metric_id is NULL
Retrieving data ...