Hi,
We configured our HostMonitoring to save the logging in a MS SQL database using ODBC.
After running more than 12 months, the database is getting very large.
Is there a way to clean up the data older then, lets say, 4 months? We are not using this old data anyway.
Thanks in advanced.
Database clean up
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You just need to execute SQL query that will clear database/table using ODBC Query test, or SQL query action.
SQL query may look like the following:
DELETE FROM hmlog WHERE DATEDIFF(MONTH,eventtime,GETDATE())>4
Please note: this SQL query uses default table name "hmlog" and defauld column name "eventtime". They may differ in your configuration.
SQL query may look like the following:
DELETE FROM hmlog WHERE DATEDIFF(MONTH,eventtime,GETDATE())>4
Please note: this SQL query uses default table name "hmlog" and defauld column name "eventtime". They may differ in your configuration.
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
BTW you may setup hostmonitor to check and/or clean up you database automatically. E.g. You may setup ODBC test or SQL Query action.
ODBC Query test may use Irregular schedule to start test every month.
SQL query action can be used with build in Scheduler, located on the Scheduler page of Options dialog.
In such case, Condition to start action should be set to "on the schedule".
Please check for more information at:
Irregular schedule: http://www.ks-soft.net/hostmon.eng/mfra ... m#Schedule
Scheduler: http://www.ks-soft.net/hostmon.eng/mfra ... #SchedPage
Condition to start action: "on the schedule": http://www.ks-soft.net/hostmon.eng/mfra ... uledaction
ODBC Query test may use Irregular schedule to start test every month.
SQL query action can be used with build in Scheduler, located on the Scheduler page of Options dialog.
In such case, Condition to start action should be set to "on the schedule".
Please check for more information at:
Irregular schedule: http://www.ks-soft.net/hostmon.eng/mfra ... m#Schedule
Scheduler: http://www.ks-soft.net/hostmon.eng/mfra ... #SchedPage
Condition to start action: "on the schedule": http://www.ks-soft.net/hostmon.eng/mfra ... uledaction