Database clean up

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
taz8707
Posts: 1
Joined: Tue May 01, 2012 3:13 am
Location: NL

Database clean up

Post by taz8707 »

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.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

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.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

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
Post Reply