#
Configuring Database Cleanup
This tool from Open iT is designed to efficiently sanitize the database by removing outdated data and decreasing its size when it has become excessively large.
Database cleanup cannot be used to fix corrupted data, archive data, or for other data-level activity. The administrator should follow the usual practices or contact Open iT Support in such instances.
#
Restrictions on Usage
Due to possible inconsistencies in the database, this tool should not run while loading data. The data loaded will be newer than the data deleted by this program.
This program must be run by the Open iT user or someone with read privileges for the Open iT database. If using the force option, the user needs additional write privileges. When generating a listing file, the indicated directory must also be writable.
To clean up data types that use (calculate) MAX/MIN values, make sure to retain the data one level below the levels that are still active. For example, when deleting data for the first half of a year while still collecting data for the last half of the year, the monthly data from the year's first half must be retained to ensure the correct calculation of yearly MAX/MIN values. To identify which data types calculate MAX/MIN, refer to the acc_types
file (it is by default in C:\Program Files\OpeniT\Core\Configuration\
or /var/opt/openit/etc/
).
Reports generated using virtual classifications will no longer work as intended if the day level of data for the time covered by the report has been removed. For data collected weekly (as may be the case with File Space data), this applies to the lowest level of data, that is, when the weekly data for those data types are deleted.
#
Database Cleanup Settings
This configuration file includes parameters that determine how the cleanup process is executed and which data type is targeted for deletion.
Open
database_cleanup.conf
inC:\Program Files\OpeniT\Core\Configuration\
.Notice that it contains instructions on how to edit the file. If configuring Analysis Server, follow the instructions specified for Analysis Server; and if configuring Core Server, follow the instructions specified for Core Server.
Specify settings by adding entries with the following syntax:
Core Server: AA:B:CCC Analysis Server: SDW:AA:B:CCC
Where:
Variable Descriptions
Save the changes.
Open
database_cleanup.conf
in/var/opt/openit/etc
.Notice that it contains instructions on how to edit the file. If configuring Analysis Server, follow the instructions specified for Analysis Server; and if configuring Core Server, follow the instructions specified for Core Server.
Specify settings by adding entries with the following syntax:
Core Server: AA:B:CCC Analysis Server: SDW:AA:B:CCC
Where:
Variable Descriptions
Save the changes.
#
Manually Running Database Cleanup
Database cleanup has various options that may be used, either alone or with other options, to fulfill the requirements.
Go to the bin directory. It is by default in
C:\Program Files\OpeniT\Core\bin\
.Open a command prompt with Administrator level privilege.
Run the following command:
database_cleanup.bat [options]
Options:
Options Descriptions
Example 1database_cleanup.bat --advice
will show:
As far as we can detect, you have some datatypes that aren't set up to be cleaned. If you wish to do so, you can use the following as an advisory on various option on how to remove data. You can paste the best options from this into your config-file. Currently C:\\Program Files\OpeniT\Core\\Configurations/database_cleanup.conf # Rules for datatype: 102 'Olap Total Use' 102:Y:3 #Delete all data older than 3 years 102:M:18 #Delete montly data older than 18 months 102:D:180 #Delete daily data older than 180 days (~ 6 months) 102:H:90 #Delete hourly and 5-minute data older than 90 days (~3 months) # Rules for datatype: 95 'Usergroup License Use v3.0' 95:Y:3 #Delete all data older than 3 years 95:M:18 #Delete montly data older than 18 months 95:D:180 #Delete daily data older than 180 days (~ 6 months) 95:H:90 #Delete hourly and 5-minute data older than 90 days (~3 months)
Example 2database_cleanup.bat --force
will show:
C:\ProgramData\OpeniT\Data\\database/102/M/2017 C:\ProgramData\OpeniT\\Data\\database/102/W/2017 All identified deletions executed
Go to the bin directory. It is by default in
/opt/openit/bin
.Open a command prompt with Administrator level privilege.
Run the following command:
database_cleanup.bat [options]
Options:
Options Descriptions
Example 1database_cleanup --advice
will show:
As far as we can detect, you have some datatypes that aren't set up to be cleaned. If you wish to do so, you can use the following as an advisory on various option on how to remove data. You can paste the best options from this into your config-file. Currently /var/opt/openit/etc/database_cleanup.conf # Rules for datatype: 102 'Olap Total Use' 102:Y:3 #Delete all data older than 3 years 102:M:18 #Delete montly data older than 18 months 102:D:180 #Delete daily data older than 180 days (~ 6 months) 102:H:90 #Delete hourly and 5-minute data older than 90 days (~3 months) # Rules for datatype: 95 'Usergroup License Use v3.0' 95:Y:3 #Delete all data older than 3 years 95:M:18 #Delete montly data older than 18 months 95:D:180 #Delete daily data older than 180 days (~ 6 months) 95:H:90 #Delete hourly and 5-minute data older than 90 days (~3 months)
Example 2database_cleanup --force
will show:
/data/database/102/M/2017 /data/database/102/W/2017 All identified deletions executed
#
Configuring Periodic Database Cleanup
In addition to manually running database cleanup, a built-in scheduler functionality allows administrators to automate the process of running cleanup tasks at regular intervals. To set up periodic database cleanup:
Open
core_database_cleanup-win.oconf
inC:\Program Files\OpeniT\Core\Configuration\scheduler
.Locate and set active value to true to activate periodic cleanup of old database based on the cleanup settings.
core_database_cleanup-win.oconf... 7| core_database_cleanup 8| { ... 16| active 17| { 18| type=bool 19| value=true ...
To change the scheduling, locate when and change the value. The default value is sunday. This accepts any day of the week.
core_database_cleanup-win.oconf... 57| scheduling 58| { ... 69| when 70| { 71| type=string 72| value=sunday ...
Save the changes.
Open
core_database_cleanup-unix.oconf
in/var/opt/openit/etc/scheduler
.Locate and set active value to true to activate periodic cleanup of old database based on the cleanup settings.
core_database_cleanup-unix.oconf... 7| core_database_cleanup 8| { ... 16| active 17| { 18| type=bool 19| value=true ...
To change the scheduling, locate when and change the value. The default value is sunday. This accepts any day of the week.
core_database_cleanup-unix.oconf... 57| scheduling 58| { ... 69| when 70| { 71| type=string 72| value=sunday ...
Save the changes.