Purge old accounting_event_detail data

version: Abiquo 2.3.X
component: database

accounting_event detail database table (located in the kinton_accounting database schema) contains the information needed to perform accounting and billing functions. You can read more about in the Abiquo Wiki.

This table accumulates significant amounts of information over time, and therefore its space requires suitable management.
In most cases, you would only want to retain a certain period of accounting data. The Abiquo system/ddbb administrator is in charge of purge this table.

You purge the accounting_event_detail table by executing a query like this:

mysql kinton_accounting -e "delete from kinton_accounting.accounting_event_detail where endtime < DATE_SUB(NOW(), INTERVAL 3 MONTH);"

In the query example, the retention time for the accounting_event_detail data is 3 months, but you can change to a suitable value for you.
Also, you can set a cron task to do this periodically.

Warning: We recommend to perform a database backup before perform any test and confirm that you are obtaining the expected result after the test execution.
Note: In Abiquo 2.0 version, accounting_event_detail table is located in kinton database.


Please sign in to leave a comment.