Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Not Applicable | - |
Resolution:
Description:
===========
How to delete TIBCO BusinessEvents metric instances which are no longer required?
Environment:
===========
TIBCO BusinessEvents 5.x
All Operating Systems
Resolution:
========
We recommend purging old metric related data during database maintenance by deleting the metric and metric_dvm records from the database. You will find the appropriate metric tables in the database table 'ClassToTable' ("select * from classtotable where Classname like 'be.gen.Dashboards%';");
For a given metric class, you have 4 tables.
1). Metric table
2). Metric references table
3). Metric DVM table
4). Metric DVM reference table
To delete old records, create a temporary table which holds the 'id' to be deleted. For example:
1). Create id table
Create table idtable (id number(19));
2). Add Ids to ID table.
e.g.
Insert into idtable select id$ from D_MT_MessagesPerService where dt_created$ < <whatever time condition you have>
3). Delete records from metric table
e.g.
Delete from D_MT_MessagesPerService where id$ in (select id from idtable);
4). Delete records from ref table
Delete from D_MT_MessagesPerService_rrf$ where id$ in (select id from idtable);
5). Delete records from D_<metric>DVM table
e.g.
Delete from D_MT_MessagesPerServiceDVM where pid$ in (select id from idtable);
6). Delete records from D_<metric>DVM_rrf$ table
Delete from D_MT_MessagesPerServiceDVM__rrf$ where pid$ in (select id from idtable);
7). Delete records from ObjectTable
e.g.
DELETE FROM OBJECTTABLE WHERE CLASSNAME = 'be.gen.Dashboards.Provisioning.MT_MessagesPerService' AND ID NOT IN ( SELECT ID$ FROM D_MT_MessagesPerService);
DELETE FROM OBJECTTABLE WHERE CLASSNAME = 'be.gen.Dashboards.Provisioning.MT_MessagesPerServiceDVM' AND ID NOT IN ( SELECT ID$ FROM D_MT_MessagesPerServiceDVM);
Note: The number of records deleted from the 'objecttable' should match those deleted from the actual table.