Navigation:  Additional Tips and Resources > Database Tips > Purging Records >

Purging Records Automatically

Top  Previous  Next

Starting with version 2.71 you can automatically purge records from MSSQL, MySQL and Oracle databases using the es_db_purge.exe command-line application. You can either run this tool at your convenience, or you can automatically schedule it to run on a regular basis (e.g. every Sunday) to completely automate the process of permanently removing old data.

 

The utility lets you specify which feature you would like to purge (e.g. event log data and performance data) and how many days you would like to keep (e.g. 180 days).

 

The database purge utility works through ODBC (the same way all other components of EventSentry connect to databases) and can be configured using command-line arguments.

 

Alert or Warning 1 24 n g

All data purged by this application will be permanently erased and only be accessible if you restore it from a working backup.

 

Required Options


<SYSTEM DSN>

 

<ACTION>

A System DSN pointing to the EventSentry database

or,

if EventSentry is installed on the same machine where you are running es_db_purge.exe then you can specify the name of the EventSentry action instead of the DSN name.

<FEATURE>

When purging records with this utility, you will need to indicate from which feature (e.g. EventLog or Performance) to actually delete the data from. See below for a list of available features, you may only select one feature at the time.

<DAYS>

Purge records that are older than the specified number of days

<USER>

Specify a user that has permissions to purge data

<PASS>

Password of <USER>



Optional Options


/count

Show how many records will be deleted, this option does not delay execution

/test

Don't actually purge data, only show how many records would be affected

 

We recommend that you schedule the utility, for example through the Windows task scheduler, to run on a regular basis at least every month. This ensures that your database does not accumulate data that is not needed anymore. Remember that the smaller the database, the less hardware you will need on your database server to keep web queries perform adequately.

 

The following table explains all feature names which may be used as the 2nd command-line argument:

 

Feature Name

Explanation

EventLog

Event log records

Diskspace

Disk space data

Performance

Performance data

ProcessTracking

Process tracking data

LogonTracking

Logon tracking data

PrintTracking

Print tracking data

HeartbeatHistory

Heartbeat history

HeartbeatPing

Heartbeat ping history

ServiceHistory

Service history

SoftwareHistory

Software history

EnviroTempHumid

Temperature and humidity (if available) data

EnviroMotion

Motion data

Nessus

Nessus data

Syslog

Syslog data

FileMonitoring

File Change monitoring data

LogFileDelimited

Data from delimited log files

LogFileNondelimited

Data from non-delimited log files