2012-07-12 07:46 AM
Is there any way to permanently remove events from OnCommand database? For other objects like hosts it's possible to run "dfm host delete -f" when only sql service is up and this will really remove the object (not only mark it as deleted).
For events I don't see such option.
Is the only way to do this by executing sql command on the database?
Solved! SEE THE SOLUTION
2012-07-12 08:12 AM
OK. I've tried to remove the event directly from database but it's not allowed
monitoring:~ # dfm database query run "delete from eventView where eventID=1;"
Error in delete from eventView where eventID=1;: (-121) [Sybase][ODBC Driver][SQL Anywhere]Permission denied: you do not have permission to delete from "eventView"
Error: Error executing delete from eventView where eventID=1;: -121: [Sybase][ODBC Driver][SQL Anywhere]Permission denied: you do not have permission to delete from "eventView"
2012-07-12 09:11 AM
There is no way to delete the events permanently from DFM server. Database user can only view the database tables but he cannot delete the data from database view.
You can use "dfm event delete <event-ids> ..." command to delete the events from dfm but this command doesn't delete the event permanently. Event will be moved to event history table
once you delete the event using this command
2012-07-12 09:54 AM
I had and still have this problem and I do not know why this is an issue. You will have to open a case with tech support. They will install some stored procedures and then run some scripts to clean out the old events. You will need to tell them what you want deleted, i.e. delete events older than 6 months, so they can customize the script. The stored procedured will need to be removed when you are done so they will not interfere with any dfm upgrades. I am about to do this myself very shortly.
2012-07-12 09:22 PM
dfm database query run are read-only views so you wont be able to delete. Also doing a dfm host delete -f does not have a cascade delete on the events table. So events will still be there.
As advised by others you can raise a case and get this cleaned. BTW how many millions of events do you have ? Is there any specific reason why you want to delete the events ?
2012-07-13 12:26 AM
There are not so many events but the VM holding OnCommand will be handed over to different customer. There are some scripts installed as well as performance views and thresholds so I don't want to thrash whole OC5. I want to keep the database but as clean as possible.
2012-07-16 10:25 AM
Since you want to clean up the db, and I assume you can afford downtime if so stop all dfm service, start only sql service and do a event delete using -f cli in a loop cli.
2012-07-18 05:11 AM
Do you want to delete the events by their date or by the content?
If first, then you can use the dfm-option 'eventsPurgeInterval'
By default, it´s set to 25.71 weeks (half a year)
Just set it to (e.g.) 1 day and then wait for another day (until DFM has reorganized it´s ultra-light database)