Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to delete historical data from an up.time Oracle DataStore.  See related articles for MySQL and MS SQL DataStores.  The tables listed in the article are valid for up.time 7; although the logic applies to any release of up.time, you may receive errors for tables that do not exist.

You may want to delete historical data historical performance data if the up.time Uptime Infrastructure Monitor Archive process has timed out and data older than the Archive Policy still exists in the data store.  You may also choose to manually delete historical data historical performance data to free up the threads for regular monitoring that the up.time Uptime Infrastructure Monitor Archive process would occupy.

For ease, a stored procedure that accomplishes the same as the statements below is available by contacting Support at [email protected].

.  Another reason to manually delete historical performance data is to shrink the size of the DataStore.

  1. The first step is to verify the oldest data samples within the DataStore.  Use the DataStore Profile script for an Oracle database found on the Support Portal's Tools & Utilities page.
  2. Once you know the oldest data sample, go to the Historical Data Purge Scripts page and download the Oracle trim script you want to run i.e. Procedure or Use Archive Settings.

    Warning
    WARNING:

...

  1. All deleted data will be lost.

...

  1.  Ensure that you complete a full data store backup before proceeding with

...

 

It is strongly recommended that you use the stored procedure that accomplishes the same outcome as the statements below with less effort.  It is available by contacting Support at [email protected].

The following commands will delete all performance data prior to a specified date:

 

  • Get the earliest sample ID for the specified day.  All data samples collected prior to this day will be deleted.  Replace DATE below with your target date in the format YYYY-MM-DD.
Code Block
languagesql
select min(id) from performance_sample where TO_CHAR(sample_time,'YYYY-MM-DD') - 'DATE';

...

  1. a trim script.
  2. Choose a date for which all data samples collected before this day will be deleted.  It is strongly recommended that deletions are completed in small chunks (e.g. 2 weeks or 1 month at a time) rather than attempting one large delete statement

...

  1. , so if the oldest data in the data store is from July 1, 2016, choose July 15, 2016 as the day to delete from.

  2. You can verify that the historical data has been deleted by running a performance graph or report in the Uptime Infrastructure Monitor UI or simply running the Datastore Profile script again.

  3. Once the data have been trimmed we also recommend working with your DBA and running the Index Rebuild script.

If you encounter any issues or have any questions regarding this process please do not hesitate to contact [email protected] for guidance.

See related articles for DataStore running on MySQL or MS SQL.

...

Code Block
languagesql
delete from performance_aggregate where sample_id < ID; commit;
delete from performance_cpu where sample_id < ID; commit;
delete from performance_disk where sample_id < ID; commit;
delete from performance_disk_total where sample_id < ID; commit;
delete from performance_esx3_workload where sample_id < ID; commit;
delete from performance_fscap where sample_id < ID; commit;
delete from performance_lpar_workload where sample_id < ID; commit;
delete from performance_network where sample_id < ID; commit;
delete from performance_nrm where sample_id < ID; commit;
delete from performance_psinfo where sample_id < ID; commit;
delete from performance_vxvol where sample_id < ID; commit;
delete from performance_who where sample_id < ID; commit;
  • The process above needs to be repeated for the VMware performance tables.  Replace DATE below with the same target date as above in the format YYYY-MM-DD.
Code Block
languagesql
select min(id) from performance_sample where TO_CHAR(sample_time,'YYYY-MM-DD') - 'DATE';

 

  • Use the ID from the previous command in place of ID in the following commands. 
Code Block
languagesql
delete from vmware_perf_aggregate where sample_id < ID; commit;
delete from vmware_perf_cluster where sample_id < ID; commit;
delete from vmware_perf_datastore_usage where sample_id < ID; commit;
delete from vmware_perf_datastore_vm_usage where sample_id < ID; commit;
delete from vmware_perf_disk_rate where sample_id < ID; commit;
delete from vmware_perf_entitlement where sample_id < ID; commit;
delete from vmware_perf_host_cpu where sample_id < ID; commit;
delete from vmware_perf_host_disk_io where sample_id < ID; commit;
delete from vmware_perf_host_disk_io_adv where sample_id < ID; commit;
delete from vmware_perf_host_network where sample_id < ID; commit;
delete from vmware_perf_host_power_state where sample_id < ID; commit;
delete from vmware_perf_mem where sample_id < ID; commit;
delete from vmware_perf_mem_advanced where sample_id < ID; commit;
delete from vmware_perf_network_rate where sample_id < ID; commit;
delete from vmware_perf_vm_cpu where sample_id < ID; commit;
delete from vmware_perf_vm_disk_io where sample_id < ID; commit;
delete from vmware_perf_vm_network where sample_id < ID; commit;
delete from vmware_perf_vm_power_state where sample_id < ID; commit;
delete from vmware_perf_vm_storage_usage where sample_id < ID; commit;
delete from vmware_perf_vm_vcpu where sample_id < ID; commit;
delete from vmware_perf_watts where sample_id < ID; commit;