diff --git a/BW_MonitoringData_Cleanup_Script/cleanupDB_Db2_script.sql b/BW_MonitoringData_Cleanup_Script/cleanupDB_Db2_script.sql new file mode 100644 index 0000000..1133a63 --- /dev/null +++ b/BW_MonitoringData_Cleanup_Script/cleanupDB_Db2_script.sql @@ -0,0 +1,29 @@ +-- +-- Cleanup the data between the given timestamp. +-- Provide low_timestamp and high_timestamp value at line number 15,22,and 29. +-- (e.g.: DELETE FROM ActivityLoggingStats +-- WHERE timestmp +-- BETWEEN 1278563669021 AND 1578563669021; +-- ). +-- + +-- +-- Delete data for table ActivityLoggingStats +-- +DELETE FROM ActivityLoggingStats +WHERE timestmp +BETWEEN 0 AND 0; + +-- +-- Delete data for table ProcessInstanceLoggingStats +-- +DELETE FROM ProcessInstanceLoggingStats +WHERE timestmp +BETWEEN 0 AND 0; + +-- +-- Delete data for table TransitionLoggingStats +-- +DELETE FROM TransitionLoggingStats +WHERE timestmp +BETWEEN 0 and 0; diff --git a/BW_MonitoringData_Cleanup_Script/cleanupDB_Mariadb_script.sql b/BW_MonitoringData_Cleanup_Script/cleanupDB_Mariadb_script.sql new file mode 100644 index 0000000..604296a --- /dev/null +++ b/BW_MonitoringData_Cleanup_Script/cleanupDB_Mariadb_script.sql @@ -0,0 +1,32 @@ +-- +-- Cleanup the data between the given timestamp. +-- Provide low_timestamp and high_timestamp value. +-- (e.g. @low_timestamp= 1578563669021;). +-- + +SET @low_timestamp= 1578563669021; +SET @high_timestamp = 1578563679090; +SET SQL_SAFE_UPDATES = 0; + +-- +-- Delete data for table ActivityLoggingStats +-- +DELETE FROM ActivityLoggingStats +WHERE timestmp +BETWEEN @low_timestamp AND @high_timestamp; + +-- +-- Delete data for table ProcessInstanceLoggingStats +-- +DELETE FROM ProcessInstanceLoggingStats +WHERE timestmp +BETWEEN @low_timestamp AND @high_timestamp; + +-- +-- Delete data for table TransitionLoggingStats +-- +DELETE FROM TransitionLoggingStats +WHERE timestmp +BETWEEN @low_timestamp AND @high_timestamp; + +SET SQL_SAFE_UPDATES = 1;