Skip to main content
Skip table of contents

Data cleansing of large data volumes

Introduction

The data cleansing function included as of version 16.1 cannot handle excessively large data volumes (>1 million, depending on database performance), because they were partly created by process implementations in version 15.2. This data must be initially cleansed manually via database statements one time before or directly after an update in order to be able to set up the correct cleansing jobs afterwards. The shorter the time span in the cleansing job, the fewer data are collected in the tables of the Activiti process engine.

The following statements only differ in the data value for MSSQL and ORACLE (getdate() and sysdate()).

It makes sense to look at the results of the following statements to get an overview of the number of process instances per process before a manual cleansing is initiated:

Number of currently running process instances
SQL
SELECT ProcessId,Count(ProcessId) AS count
 FROM ProcessInstance
 GROUP BY ProcessId
 ORDER BY count DESC


Number of process instances

SQL
SELECT ACT_RE_PROCDEF.NAME_, COUNT(ACT_HI_PROCINST.ID_) AS count
 FROM ACT_RE_PROCDEF, ACT_HI_PROCINST
 WHERE ACT_HI_PROCINST.PROC_DEF_ID_ = ACT_RE_PROCDEF.ID_
 /* AND START_TIME_ < (SYSDATE - 100) AND END_TIME_ IS NULL */
 GROUP BY ACT_RE_PROCDEF.NAME_
 ORDER BY count DESC


Number of completed actions per process

SQL
SELECT ACT_RE_PROCDEF.NAME_, COUNT(ACT_HI_ACTINST.ID_) AS count
 FROM ACT_RE_PROCDEF, ACT_HI_PROCINST, ACT_HI_ACTINST
 WHERE ACT_HI_PROCINST.PROC_DEF_ID_ = ACT_RE_PROCDEF.ID_
  AND ACT_HI_ACTINST.PROC_INST_ID_ = ACT_HI_PROCINST.ID_
 GROUP BY ACT_RE_PROCDEF.NAME_
 ORDER BY count DESC ;

These statements allow an identification of the processes that leave behind the most data in the process tables, even though no report is required for these processes in CURSOR-BPM.

Cleanup in the test system

The test system only contains test data. Here, all process tables can be cleaned up completely and efficiently.

Warning

The following statements delete currently running instances as well as all historicized data. Only deployed process definitions will remain intact in the Activiti tables.

Make sure to shut down the JBoss application server of the test system before these statements are triggered. The correct sequence of these statements is of crucial importance!

Delete Runtime tables
SQL
TRUNCATE TABLE ACT_RU_VARIABLE;
TRUNCATE TABLE ACT_RU_JOB;
TRUNCATE TABLE ACT_RU_TIMER_JOB;
TRUNCATE TABLE ACT_RU_SUSPENDED_JOB;
TRUNCATE TABLE ACT_RU_DEADLETTER_JOB;
TRUNCATE TABLE ACT_RU_IDENTITYLINK;
TRUNCATE TABLE ACT_RU_TASK;
TRUNCATE TABLE ACT_RU_EXECUTION;
TRUNCATE TABLE ACT_RU_INTEGRATION;

/* Teilweise kann ein TRUNCATE unter ORCALE wegen Fehler der referenzieller Integrität nicht abgesetzt werden.
   Dieses muss dann durch ein DELETE mit anschließender Tabellen-Verkleinerung ersetzt werden. */
TRUNCATE TABLE ACT_RU_VARIABLE;
TRUNCATE TABLE ACT_RU_JOB;
TRUNCATE TABLE ACT_RU_TIMER_JOB;
TRUNCATE TABLE ACT_RU_SUSPENDED_JOB;
TRUNCATE TABLE ACT_RU_DEADLETTER_JOB;
TRUNCATE TABLE ACT_RU_IDENTITYLINK;
TRUNCATE TABLE ACT_RU_INTEGRATION;

DELETE FROM ACT_RU_EVENT_SUBSCR WHERE PROC_INST_ID_ IS NOT NULL;
 
DELETE FROM ACT_RU_TASK;
ALTER TABLE ACT_RU_TASK enable row movement;
ALTER TABLE ACT_RU_TASK shrink space cascade;
ALTER TABLE ACT_RU_TASK disable row movement;
 
DELETE FROM ACT_RU_EXECUTION;
ALTER TABLE ACT_RU_EXECUTION enable row movement;
ALTER TABLE ACT_RU_EXECUTION shrink space cascade;
ALTER TABLE ACT_RU_EXECUTION disable row movement;

Make sure that the history tables also include data on running instances.

Delete history tables
SQL
TRUNCATE TABLE ACT_HI_VARINST;
TRUNCATE TABLE ACT_HI_ACTINST;
TRUNCATE TABLE ACT_HI_TASKINST;
TRUNCATE TABLE ACT_HI_IDENTITYLINK;
TRUNCATE TABLE ACT_HI_PROCINST;

The table ACT_GE_BYTEARRAY contains process variables and the process deployment. All processes would have to be deployed again if the content of this table was cleared completely! Use the statements from section Useful cleanup statements in case of large data volumes (>1,000,000) in this table.

Delete blob tables
SQL
DELETE FROM ACT_GE_BYTEARRAY WHERE Deployment_Id_ IS NULL;
 
/* Unter ORACLE sollte die Tabelle nach dem DELETE verkleinert werden. */
ALTER TABLE ACT_GE_BYTEARRAY enable row movement;
ALTER TABLE ACT_GE_BYTEARRAY shrink space cascade;
ALTER TABLE ACT_GE_BYTEARRAY disable row movement;

/* Falls es sich um ein 'secure file LOB' Segment handelt, muss ein anderes Statement zum Verkleinern genutzt werden: https://oracle-base.com/articles/misc/alter-table-shrink-space-online */
ALTER TABLE ACT_GE_BYTEARRAY MOVE LOB(BYTES_) STORE AS (TABLESPACE <used_table_space>)
/* Indices der Tabelle ACT_GE_BYTEARRAY müssen neu aufgebaut werden */
declare
 v_cursor integer := DBMS_SQL.OPEN_CURSOR;
begin
 for v_rec in ( select * from USER_INDEXES where index_type in ('NORMAL', 'FUNCTION-BASED NORMAL') and table_name = 'ACT_GE_BYTEARRAY' ) loop
  DBMS_SQL.PARSE( v_cursor , 'ALTER INDEX '||v_rec.INDEX_NAME||' REBUILD ' , DBMS_SQL.NATIVE );
 end loop;
 DBMS_SQL.CLOSE_CURSOR(v_cursor);
end;

The process tables contained in CRM also have to be cleaned up.

Delete blob tables
SQL
TRUNCATE TABLE ProcessInstance;
TRUNCATE TABLE ProcessWaitStat;
TRUNCATE TABLE ProcessErrorLog;

Cleanup in the production system

The running process instances in the production system must not be deleted. This can be done only in special circumstances if

  • Processes were not exited correctly by the user,

  • Open instances were left behind due to errors, or

  • Individual processes run in endless loops.

The process history will in some cases also be needed for runtime reports of processes. It is crucial to consider the business requirements for the processes and to gain an exact overview of the number of instances in each process. Most of the time it is a handful of processes that take up 95% of the Activity tables. It is exactly these processes that need cleaning up manually, before the cleansing jobs can be set up for version 16.1 and later.

Deleting instances with error runs

This is an optional action if there are no instances with errors in the system of if these can be removed via the CURSOR-BPM GUI.

The instance information is provided in the table ProcessInstance for more detailed verifications

Information about running processes
SQL
SELECT ProcessId, ActivitiName, InstanceId, StartUser, UserId, UpdateDate
 FROM ProcessInstance

All relevant instances must be collected in a temporary table. The restrictions should be determined for each customer specifically.

Temporary table TMP_ACT_RU_PROCINST
SQL
CREATE TABLE TMP_ACT_RU_PROCINST AS
 (SELECT InstanceId FROM ProcessInstance
  WHERE ProcessId IN ('...')
  /* AND ActivitiName LIKE '%...' */ );
 
/* Alle laufenden Instanzen löschen */
CREATE TABLE TMP_ACT_RU_PROCINST AS
 (SELECT DISTINCT PROC_INST_ID_ AS InstanceId FROM ACT_RU_EXECUTION);
 
/* Instanzen die älter 100 Tage sind löschen */ 
CREATE TABLE TMP_ACT_RU_PROCINST AS
 (SELECT ID_ AS InstanceId FROM ACT_HI_PROCINST WHERE START_TIME_ < (SYSDATE - 100) AND END_TIME_ IS NULL);

/* Alle laufenden Instanzen eines bestimmten Prozesses löschen */
CREATE TABLE TMP_ACT_RU_PROCINST AS
 (SELECT ACT_HI_PROCINST.ID_ FROM ACT_RE_PROCDEF, ACT_HI_PROCINST
  WHERE ACT_HI_PROCINST.PROC_DEF_ID_ = ACT_RE_PROCDEF.ID_
   AND ACT_RE_PROCDEF.NAME_ = '...'
);

This temporary table will assist in deleting the runtime information of the processes.

Deleting running process instances
SQL
DELETE FROM ACT_HI_PROCINST WHERE ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);


Deleting runtime variables

SQL
CREATE TABLE TMP_ACT_RU_BYTEARRAY AS
 (SELECT BYTEARRAY_ID_ FROM ACT_RU_VARIABLE
  WHERE BYTEARRAY_ID_ IS NOT NULL AND PROC_INST_ID_ IN
   (SELECT InstanceId FROM TMP_ACT_RU_PROCINST));
 
DELETE FROM ACT_RU_VARIABLE WHERE PROC_INST_ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);
 
DELETE FROM ACT_GE_BYTEARRAY where ID_ IN
 (SELECT BYTEARRAY_ID_ FROM TMP_ACT_RU_BYTEARRAY);
 
DROP TABLE TMP_ACT_RU_BYTEARRAY;


Deleting open user tasks

SQL
CREATE TABLE TMP_ACT_RU_TASK AS
 (SELECT ID_ FROM ACT_RU_TASK WHERE PROC_INST_ID_ IN
  (SELECT InstanceId FROM TMP_ACT_RU_PROCINST));
 
DELETE FROM ACT_RU_IDENTITYLINK WHERE PROC_INST_ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_IDENTITYLINK WHERE TASK_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_TASK);
 
DELETE FROM ACT_RU_TASK WHERE PROC_INST_ID_ IN (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);
 
DROP TABLE TMP_ACT_RU_TASK;


Deleting instances

SQL
DELETE FROM ACT_RU_JOB WHERE PROCESS_INSTANCE_ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_TIMER_JOB WHERE PROCESS_INSTANCE_ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_SUSPENDED_JOB WHERE PROCESS_INSTANCE_ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_DEADLETTER_JOB WHERE PROCESS_INSTANCE_ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);

DELETE FROM ACT_RU_EVENT_SUBSCR WHERE PROC_INST_ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);

DELETE FROM ACT_RU_INTEGRATION WHERE PROCESS_INSTANCE_ID_ IN
(SELECT InstanceId FROM TMP_ACT_RU_PROCINST);

DELETE FROM ACT_RU_EXECUTION WHERE SUPER_EXEC_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_EXECUTION WHERE PROC_INST_ID_ IN
 (SELECT InstanceId FROM TMP_ACT_RU_PROCINST);


Delete temporary table

SQL
DROP TABLE TMP_ACT_RU_PROCINST;

All runtime information was now removed from the Activiti tables for the previously specified selection. Some data remains in the history tables, which also apply for the running instances. The header data in the table ACT_HI_PROCINST was deleted. All third party key relationships are therefore now invalid and must also be deleted. (See "Cleansing related data")

Clean running instances in MSSQL
SQL
SELECT ACT_HI_PROCINST.ID_ INTO TMP_ACT_RU_PROCINST FROM ACT_RE_PROCDEF, ACT_HI_PROCINST
  WHERE ACT_HI_PROCINST.PROC_DEF_ID_ = ACT_RE_PROCDEF.ID_
   AND ACT_RE_PROCDEF.NAME_ = '...'
   AND END_TIME_ IS NULL)
   AND START_TIME_ < (GETDATE() - 1);

DELETE FROM ACT_HI_PROCINST WHERE ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
 
SELECT BYTEARRAY_ID_ INTO TMP_ACT_RU_BYTEARRAY FROM ACT_RU_VARIABLE
  WHERE BYTEARRAY_ID_ IS NOT NULL AND PROC_INST_ID_ IN
   (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
  
DELETE FROM ACT_RU_VARIABLE WHERE PROC_INST_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
  
DELETE FROM ACT_GE_BYTEARRAY where ID_ IN
 (SELECT BYTEARRAY_ID_ FROM TMP_ACT_RU_BYTEARRAY);
  
DROP TABLE TMP_ACT_RU_BYTEARRAY;

SELECT ID_ INTO TMP_ACT_RU_TASK FROM ACT_RU_TASK WHERE PROC_INST_ID_ IN
  (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
  
DELETE FROM ACT_RU_IDENTITYLINK WHERE PROC_INST_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_IDENTITYLINK WHERE TASK_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_TASK);
  
DELETE FROM ACT_RU_TASK WHERE PROC_INST_ID_ IN
  (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
  
DROP TABLE TMP_ACT_RU_TASK;

DELETE FROM ACT_RU_JOB WHERE PROCESS_INSTANCE_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_TIMER_JOB WHERE PROCESS_INSTANCE_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_SUSPENDED_JOB WHERE PROCESS_INSTANCE_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_DEADLETTER_JOB WHERE PROCESS_INSTANCE_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
 
DELETE FROM ACT_RU_EVENT_SUBSCR WHERE PROC_INST_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
 
DELETE FROM ACT_RU_EXECUTION WHERE SUPER_EXEC_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
DELETE FROM ACT_RU_EXECUTION WHERE PROC_INST_ID_ IN
 (SELECT ID_ FROM TMP_ACT_RU_PROCINST);
 
DROP TABLE TMP_ACT_RU_PROCINST;

Deleting the process history

An entry exists for each completed process instance in the table ACT_HI_PROCINST. Where processes are run very frequently, this can easily be several hundred entries per day. These are often script processes, which are run in the background and which will not be included in CURSOR-CRM reporting. These process instances should be cleaned up on a daily basis via the cleansing jobs. The following statement can be started multiple times for different processes using differing time values (monthly instead of daily).

Deleting completed process instances
SQL
DELETE FROM ACT_HI_PROCINST
 WHERE END_TIME_ IS NOT NULL AND END_TIME_ < (SYSDATE - 1) /* für MSSQL (GETDATE() - 1) */
  AND PROC_DEF_ID_ IN (SELECT pd.ID_ FROM ACT_RE_PROCDEF pd WHERE pd.NAME_ IN ('XXX')) /*'XXX' kann durch die IDs der Prozesse ersetzt werden */

Cleansing related data

More entries will contain additional information related to running process instances containing errors that were deleted complete with their script process history. Running these statements can take several hours, depending on the volume of data.

Deleting related data
SQL
/* Altdaten in Hisotry-Tabellen */
DELETE FROM ACT_GE_BYTEARRAY where ID_ IN
 (SELECT BYTEARRAY_ID_ FROM ACT_HI_VARINST WHERE PROC_INST_ID_ NOT IN (SELECT ID_ FROM ACT_HI_PROCINST));
DELETE FROM ACT_HI_VARINST WHERE PROC_INST_ID_ NOT IN (SELECT ID_ FROM ACT_HI_PROCINST);
DELETE FROM ACT_HI_ACTINST WHERE PROC_INST_ID_ NOT IN (SELECT ID_ FROM ACT_HI_PROCINST);
DELETE FROM ACT_HI_IDENTITYLINK WHERE TASK_ID_ NOT IN (SELECT ID_ FROM ACT_HI_TASKINST);
DELETE FROM ACT_HI_TASKINST WHERE PROC_INST_ID_ NOT IN (SELECT ID_ FROM ACT_HI_PROCINST);

/* Altdaten in CRM-Tabellen */
DELETE FROM ProcessInstance WHERE Active = 0;
DELETE FROM ProcessInstance WHERE InstanceId NOT IN (SELECT ID_ FROM ACT_HI_PROCINST);
DELETE FROM ProcessWaitStat WHERE Active = 0;
DELETE FROM ProcessErrorLog WHERE Active = 0 OR ProcessInstance NOT IN (SELECT ID_ FROM ACT_HI_PROCINST);

Shortening the database tales

The many deletions in the tables have caused them to be fragmented in ORACLE, while the database files still have their original size of in part several GB. It is recommended to shorten all tables to allow the database performance to increase.

ORACLE shrink commands
SQL
/* BLOB Tabelle */
ALTER TABLE ACT_GE_BYTEARRAY enable row movement;
ALTER TABLE ACT_GE_BYTEARRAY shrink space cascade;
ALTER TABLE ACT_GE_BYTEARRAY disable row movement;

/* Falls es sich um ein 'secure file LOB' Segment handelt, muss ein anderes Statement zum Verkleinern genutzt werden: https://oracle-base.com/articles/misc/alter-table-shrink-space-online */
ALTER TABLE ACT_GE_BYTEARRAY MOVE LOB(BYTES_) STORE AS (TABLESPACE <used_table_space>)
/* Indices der Tabelle ACT_GE_BYTEARRAY müssen neu aufgebaut werden */
declare
 v_cursor integer := DBMS_SQL.OPEN_CURSOR;
begin
 for v_rec in ( select * from USER_INDEXES where index_type in ('NORMAL', 'FUNCTION-BASED NORMAL') and table_name = 'ACT_GE_BYTEARRAY' ) loop
  DBMS_SQL.PARSE( v_cursor , 'ALTER INDEX '||v_rec.INDEX_NAME||' REBUILD ' , DBMS_SQL.NATIVE );
 end loop;
 DBMS_SQL.CLOSE_CURSOR(v_cursor);
end;
 
/* Runtime Tabellen */
ALTER TABLE ACT_RU_VARIABLE enable row movement;
ALTER TABLE ACT_RU_VARIABLE shrink space cascade;
ALTER TABLE ACT_RU_VARIABLE disable row movement;
 
ALTER TABLE ACT_RU_JOB enable row movement;
ALTER TABLE ACT_RU_JOB shrink space cascade;
ALTER TABLE ACT_RU_JOB disable row movement;

ALTER TABLE ACT_RU_TIMER_JOB enable row movement;
ALTER TABLE ACT_RU_TIMER_JOB shrink space cascade;
ALTER TABLE ACT_RU_TIMER_JOB disable row movement;

ALTER TABLE ACT_RU_SUSPENDED_JOB enable row movement;
ALTER TABLE ACT_RU_SUSPENDED_JOB shrink space cascade;
ALTER TABLE ACT_RU_SUSPENDED_JOB disable row movement;

ALTER TABLE ACT_RU_DEADLETTER_JOB enable row movement;
ALTER TABLE ACT_RU_DEADLETTER_JOB shrink space cascade;
ALTER TABLE ACT_RU_DEADLETTER_JOB disable row movement;
ALTER TABLE ACT_RU_EVENT_SUBSCR enable row movement;
ALTER TABLE ACT_RU_EVENT_SUBSCR shrink space cascade;
ALTER TABLE ACT_RU_EVENT_SUBSCR disable row movement;
 
ALTER TABLE ACT_RU_IDENTITYLINK enable row movement;
ALTER TABLE ACT_RU_IDENTITYLINK shrink space cascade;
ALTER TABLE ACT_RU_IDENTITYLINK disable row movement;
 
ALTER TABLE ACT_RU_TASK enable row movement;
ALTER TABLE ACT_RU_TASK shrink space cascade;
ALTER TABLE ACT_RU_TASK disable row movement;
 
ALTER TABLE ACT_RU_EXECUTION enable row movement;
ALTER TABLE ACT_RU_EXECUTION shrink space cascade;
ALTER TABLE ACT_RU_EXECUTION disable row movement;

ALTER TABLE ACT_RU_INTEGRATION enable row movement;
ALTER TABLE ACT_RU_INTEGRATION shrink space cascade;
ALTER TABLE ACT_RU_INTEGRATION disable row movement;

/* History Tabellen */
ALTER TABLE ACT_HI_VARINST enable row movement;
ALTER TABLE ACT_HI_VARINST shrink space cascade;
ALTER TABLE ACT_HI_VARINST disable row movement;

ALTER TABLE ACT_HI_ACTINST enable row movement;
ALTER TABLE ACT_HI_ACTINST shrink space cascade;
ALTER TABLE ACT_HI_ACTINST disable row movement;

ALTER TABLE ACT_HI_IDENTITYLINK enable row movement;
ALTER TABLE ACT_HI_IDENTITYLINK shrink space cascade;
ALTER TABLE ACT_HI_IDENTITYLINK disable row movement;
 
ALTER TABLE ACT_HI_PROCINST enable row movement;
ALTER TABLE ACT_HI_PROCINST shrink space cascade;
ALTER TABLE ACT_HI_PROCINST disable row movement;
 
ALTER TABLE ACT_HI_TASKINST enable row movement;
ALTER TABLE ACT_HI_TASKINST shrink space cascade;
ALTER TABLE ACT_HI_TASKINST disable row movement;
 
/* CRM Tabellen */
ALTER TABLE ProcessInstance enable row movement;
ALTER TABLE ProcessInstance shrink space cascade;
ALTER TABLE ProcessInstance disable row movement;

ALTER TABLE ProcessWaitStat enable row movement;
ALTER TABLE ProcessWaitStat shrink space cascade;
ALTER TABLE ProcessWaitStat disable row movement;
 
ALTER TABLE ProcessErrorLog enable row movement;
ALTER TABLE ProcessErrorLog shrink space cascade;
ALTER TABLE ProcessErrorLog disable row movement;

Full cleanup

The JBoss application server must be shut down to run the cleanup statements to ensure that no processes are run in parallel.

Complete cleanup under ORACLE
SQL
/*** Produktiv- bzw. Test-System mit Sicherungen und Truncates bereinigen ***/
/*** Der JBoss muss heruntergefahren werden - LAufzeit ca 15-30min        ***/
/*** Trennzeichen im SQL-Editor: ?%!                                      ***/
/*** Ab hier das SQL-Skript in den SQL-Editor kopieren		              ***/

/* 01: constraints deaktivieren */
BEGIN
  /* 1. constraint */
  FOR v_rec IN (
    SELECT * FROM User_Constraints WHERE Constraint_Type = 'C' AND Table_Name IN
     ('ACT_GE_BYTEARRAY','ACT_RE_DEPLOYMENT','ACT_RE_MODEL','ACT_RU_EXECUTION','ACT_RU_JOB','ACT_RU_TIMER_JOB','ACT_RU_SUSPENDED_JOB','ACT_RU_DEADLETTER_JOB','ACT_RE_PROCDEF','ACT_RU_TASK','ACT_RU_IDENTITYLINK','ACT_RU_VARIABLE','ACT_RU_EVENT_SUBSCR','ACT_EVT_LOG','ACT_PROCDEF_INFO','ACT_RU_INTEGRATION')
  )
  LOOP
    EXECUTE IMMEDIATE 'ALTER TABLE '||v_rec.Table_name||' DISABLE CONSTRAINT '||v_rec.constraint_name;
  END LOOP;
  /* 2. foreign key */
  FOR v_rec IN (
    SELECT * FROM User_Constraints WHERE Constraint_Type = 'R' AND Table_Name IN
     ('ACT_GE_BYTEARRAY','ACT_RE_DEPLOYMENT','ACT_RE_MODEL','ACT_RU_EXECUTION','ACT_RU_JOB','ACT_RU_TIMER_JOB','ACT_RU_SUSPENDED_JOB','ACT_RU_DEADLETTER_JOB','ACT_RE_PROCDEF','ACT_RU_TASK','ACT_RU_IDENTITYLINK','ACT_RU_VARIABLE','ACT_RU_EVENT_SUBSCR','ACT_EVT_LOG','ACT_PROCDEF_INFO','ACT_RU_INTEGRATION')
  )
  LOOP
    EXECUTE IMMEDIATE 'ALTER TABLE '||v_rec.Table_name||' DISABLE CONSTRAINT '||v_rec.constraint_name;
  END LOOP;
  /* 3. primary key */
  FOR v_rec IN (
    SELECT * FROM User_Constraints WHERE Constraint_Type = 'P' AND Table_Name IN
     ('ACT_GE_BYTEARRAY','ACT_RE_DEPLOYMENT','ACT_RE_MODEL','ACT_RU_EXECUTION','ACT_RU_JOB','ACT_RU_TIMER_JOB','ACT_RU_SUSPENDED_JOB','ACT_RU_DEADLETTER_JOB','ACT_RE_PROCDEF','ACT_RU_TASK','ACT_RU_IDENTITYLINK','ACT_RU_VARIABLE','ACT_RU_EVENT_SUBSCR','ACT_EVT_LOG','ACT_PROCDEF_INFO','ACT_RU_INTEGRATION')
  )
  LOOP
    EXECUTE IMMEDIATE 'ALTER TABLE '||v_rec.Table_name||' DISABLE CONSTRAINT '||v_rec.constraint_name;
  END LOOP;
END;
?%!

/* 02: Laufzeitdaten und History von 30 Tagen sichern */
CREATE TABLE TMPACT_HI_PROCINST_ID AS
 (SELECT ID_ FROM ACT_HI_PROCINST WHERE END_TIME_ IS NULL) ?%!   
INSERT INTO TMPACT_HI_PROCINST_ID (SELECT ID_ FROM ACT_HI_PROCINST WHERE END_TIME_ IS NOT NULL AND END_TIME_ > (SYSDATE - 30)) ?%!   

CREATE TABLE TMPACT_HI_PROCINST AS (SELECT * FROM ACT_HI_PROCINST WHERE ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!
CREATE TABLE TMPACT_HI_ACTINST AS (SELECT * FROM ACT_HI_ACTINST WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!
CREATE TABLE TMPACT_HI_TASKINST AS (SELECT * FROM ACT_HI_TASKINST WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!
CREATE TABLE TMPACT_HI_IDENTITYLINK AS (SELECT * FROM ACT_HI_IDENTITYLINK WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!
CREATE TABLE TMPACT_HI_VARINST AS (SELECT * FROM ACT_HI_VARINST WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!
CREATE TABLE TMPACT_HI_DETAIL AS (SELECT * FROM ACT_HI_DETAIL WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!

CREATE TABLE TMPACT_ACT_GE_BYTEARRAY_ID AS (SELECT ID_ FROM ACT_GE_BYTEARRAY WHERE DEPLOYMENT_ID_ IS NOT NULL)?%!
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID (SELECT BYTEARRAY_ID_ FROM ACT_RU_VARIABLE WHERE BYTEARRAY_ID_ IS NOT NULL)?%!
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID (SELECT EXCEPTION_STACK_ID_ FROM ACT_RU_JOB WHERE EXCEPTION_STACK_ID_ IS NOT NULL)?%!
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID (SELECT EXCEPTION_STACK_ID_ FROM ACT_RU_TIMER_JOB WHERE EXCEPTION_STACK_ID_ IS NOT NULL)?%!
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID (SELECT EXCEPTION_STACK_ID_ FROM ACT_RU_SUSPENDED_JOB WHERE EXCEPTION_STACK_ID_ IS NOT NULL)?%!
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID (SELECT EXCEPTION_STACK_ID_ FROM ACT_RU_DEADLETTER_JOB WHERE EXCEPTION_STACK_ID_ IS NOT NULL)?%!
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID (SELECT BYTEARRAY_ID_ FROM ACT_HI_VARINST WHERE BYTEARRAY_ID_ IS NOT NULL AND PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!

CREATE TABLE TMPACT_GE_BYTEARRAY AS (SELECT * FROM ACT_GE_BYTEARRAY WHERE ID_ IN (SELECT ID_ FROM TMPACT_ACT_GE_BYTEARRAY_ID))?%!

CREATE TABLE TMPACT_ProcessInstance AS (SELECT * FROM ProcessInstance WHERE InstanceId IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!
CREATE TABLE TMPACT_ProcessErrorLog AS (SELECT * FROM ProcessErrorLog WHERE ProcessInstance IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID))?%!
CREATE TABLE TMPACT_ProcessWaitStat AS (SELECT * FROM ProcessWaitStat WHERE InternalProcessId IN (SELECT ID_ FROM ACT_RU_EXECUTION))?%!

DROP TABLE TMPACT_ACT_GE_BYTEARRAY_ID?%!
DROP TABLE TMPACT_HI_PROCINST_ID?%!

/* 03: Tabelle leeren */
TRUNCATE TABLE ACT_HI_PROCINST?%!
TRUNCATE TABLE ACT_HI_ACTINST?%!
TRUNCATE TABLE ACT_HI_TASKINST?%!
TRUNCATE TABLE ACT_HI_IDENTITYLINK?%!
TRUNCATE TABLE ACT_HI_VARINST?%!
TRUNCATE TABLE ACT_HI_DETAIL?%!
TRUNCATE TABLE ACT_GE_BYTEARRAY?%!
TRUNCATE TABLE ProcessInstance?%!
TRUNCATE TABLE ProcessErrorLog?%!
TRUNCATE TABLE ProcessWaitStat?%!

/* 04: gültige Daten zurückspielen */
INSERT INTO ACT_HI_PROCINST     (select * from TMPACT_HI_PROCINST)?%!
INSERT INTO ACT_HI_ACTINST      (select * from TMPACT_HI_ACTINST)?%!
INSERT INTO ACT_HI_TASKINST     (select * from TMPACT_HI_TASKINST)?%!
INSERT INTO ACT_HI_IDENTITYLINK (select * from TMPACT_HI_IDENTITYLINK)?%!
INSERT INTO ACT_HI_VARINST      (select * from TMPACT_HI_VARINST)?%!
INSERT INTO ACT_HI_DETAIL       (select * from TMPACT_HI_DETAIL)?%!
INSERT INTO ACT_GE_BYTEARRAY    (select * from TMPACT_GE_BYTEARRAY)?%!
INSERT INTO ProcessInstance    (select * from TMPACT_ProcessInstance)?%!
INSERT INTO ProcessErrorLog    (select * from TMPACT_ProcessErrorLog)?%!
INSERT INTO ProcessWaitStat    (select * from TMPACT_ProcessWaitStat)?%!

/* 05: Tmp Tabellen löschen */
DROP TABLE TMPACT_HI_PROCINST?%!
DROP TABLE TMPACT_HI_ACTINST?%!
DROP TABLE TMPACT_HI_TASKINST?%!
DROP TABLE TMPACT_HI_IDENTITYLINK?%!
DROP TABLE TMPACT_HI_VARINST?%!
DROP TABLE TMPACT_HI_DETAIL?%!
DROP TABLE TMPACT_GE_BYTEARRAY?%!
DROP TABLE TMPACT_ProcessInstance?%!
DROP TABLE TMPACT_ProcessErrorLog?%!
DROP TABLE TMPACT_ProcessWaitStat?%!

/* 06: constraints aktivieren */
BEGIN
  /* 1. primary key */
  FOR v_rec IN (
    SELECT * FROM User_Constraints WHERE Constraint_Type = 'P' AND Table_Name IN
     ('ACT_GE_BYTEARRAY','ACT_RE_DEPLOYMENT','ACT_RE_MODEL','ACT_RU_EXECUTION','ACT_RU_JOB','ACT_RU_TIMER_JOB','ACT_RU_SUSPENDED_JOB','ACT_RU_DEADLETTER_JOB','ACT_RE_PROCDEF','ACT_RU_TASK','ACT_RU_IDENTITYLINK','ACT_RU_VARIABLE','ACT_RU_EVENT_SUBSCR','ACT_EVT_LOG','ACT_PROCDEF_INFO','ACT_RU_INTEGRATION')
  )
  LOOP
    EXECUTE IMMEDIATE 'ALTER TABLE '||v_rec.Table_name||' ENABLE CONSTRAINT '||v_rec.constraint_name;
  END LOOP;
  /* 2. foreign key */
  FOR v_rec IN (
    SELECT * FROM User_Constraints WHERE Constraint_Type = 'R' AND Table_Name IN
     ('ACT_GE_BYTEARRAY','ACT_RE_DEPLOYMENT','ACT_RE_MODEL','ACT_RU_EXECUTION','ACT_RU_JOB','ACT_RU_TIMER_JOB','ACT_RU_SUSPENDED_JOB','ACT_RU_DEADLETTER_JOB','ACT_RE_PROCDEF','ACT_RU_TASK','ACT_RU_IDENTITYLINK','ACT_RU_VARIABLE','ACT_RU_EVENT_SUBSCR','ACT_EVT_LOG','ACT_PROCDEF_INFO','ACT_RU_INTEGRATION')
  )
  LOOP
    EXECUTE IMMEDIATE 'ALTER TABLE '||v_rec.Table_name||' ENABLE CONSTRAINT '||v_rec.constraint_name;
  END LOOP;
  /* 3. constraint */
  FOR v_rec IN (
    SELECT * FROM User_Constraints WHERE Constraint_Type = 'C' AND Table_Name IN
     ('ACT_GE_BYTEARRAY','ACT_RE_DEPLOYMENT','ACT_RE_MODEL','ACT_RU_EXECUTION','ACT_RU_JOB','ACT_RU_TIMER_JOB','ACT_RU_SUSPENDED_JOB','ACT_RU_DEADLETTER_JOB','ACT_RE_PROCDEF','ACT_RU_TASK','ACT_RU_IDENTITYLINK','ACT_RU_VARIABLE','ACT_RU_EVENT_SUBSCR','ACT_EVT_LOG','ACT_PROCDEF_INFO','ACT_RU_INTEGRATION')
  )
  LOOP
    EXECUTE IMMEDIATE 'ALTER TABLE '||v_rec.Table_name||' ENABLE CONSTRAINT '||v_rec.constraint_name;
  END LOOP;
END;

?%!


Complete cleanup under MSSQL

SQL
/*** Produktiv-System mit Sicherungen und Truncates bereinigen ***/
/*** Trennzeichen im SQL-Editor: ;                             ***/
/*** Ab hier das SQL-Skript in den SQL-Editor kopieren		   ***/

/* 01: constraints deaktivieren */
/* Dieses Statement manuell ausführen und dann Ergebniszeilen als Skript ausführen */
SELECT 'ALTER TABLE ' + Table_name + ' NOCHECK CONSTRAINT ' + constraint_name + ';'
  FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
  WHERE Table_Name IN ('ACT_GE_BYTEARRAY','ACT_RE_DEPLOYMENT','ACT_RE_MODEL','ACT_RU_EXECUTION','ACT_RU_JOB','ACT_RU_TIMER_JOB','ACT_RU_SUSPENDED_JOB','ACT_RU_DEADLETTER_JOB','ACT_RE_PROCDEF','ACT_RU_TASK','ACT_RU_IDENTITYLINK','ACT_RU_VARIABLE','ACT_RU_EVENT_SUBSCR','ACT_EVT_LOG','ACT_PROCDEF_INFO','ACT_RU_INTEGRATION')
  AND CONSTRAINT_TYPE in ('FOREIGN KEY')

/* 02: Laufzeitdaten und History von 10 Tagen sichern */
SELECT ID_ INTO TMPACT_HI_PROCINST_ID FROM ACT_HI_PROCINST WHERE END_TIME_ IS NULL;   
INSERT INTO TMPACT_HI_PROCINST_ID SELECT ID_ FROM ACT_HI_PROCINST WHERE END_TIME_ IS NOT NULL AND END_TIME_ > (GETDATE() - 10) ;   

SELECT * INTO TMPACT_HI_PROCINST FROM ACT_HI_PROCINST WHERE ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);
SELECT * INTO TMPACT_HI_ACTINST FROM ACT_HI_ACTINST WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);
SELECT * INTO TMPACT_HI_TASKINST FROM ACT_HI_TASKINST WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);
SELECT * INTO TMPACT_HI_IDENTITYLINK FROM ACT_HI_IDENTITYLINK WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);
SELECT * INTO TMPACT_HI_VARINST FROM ACT_HI_VARINST WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);
SELECT * INTO TMPACT_HI_DETAIL FROM ACT_HI_DETAIL WHERE PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);

SELECT ID_ INTO TMPACT_ACT_GE_BYTEARRAY_ID FROM ACT_GE_BYTEARRAY WHERE DEPLOYMENT_ID_ IS NOT NULL;
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID SELECT BYTEARRAY_ID_ FROM ACT_RU_VARIABLE WHERE BYTEARRAY_ID_ IS NOT NULL;
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID SELECT EXCEPTION_STACK_ID_ FROM ACT_RU_JOB WHERE EXCEPTION_STACK_ID_ IS NOT NULL;
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID SELECT EXCEPTION_STACK_ID_ FROM ACT_RU_TIMER_JOB WHERE EXCEPTION_STACK_ID_ IS NOT NULL;
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID SELECT EXCEPTION_STACK_ID_ FROM ACT_RU_SUSPENDED_JOB WHERE EXCEPTION_STACK_ID_ IS NOT NULL;
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID SELECT EXCEPTION_STACK_ID_ FROM ACT_RU_DEADLETTER_JOB WHERE EXCEPTION_STACK_ID_ IS NOT NULL;
INSERT INTO TMPACT_ACT_GE_BYTEARRAY_ID SELECT BYTEARRAY_ID_ FROM ACT_HI_VARINST WHERE BYTEARRAY_ID_ IS NOT NULL AND PROC_INST_ID_ IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);

SELECT * INTO TMPACT_GE_BYTEARRAY FROM ACT_GE_BYTEARRAY WHERE ID_ IN (SELECT ID_ FROM TMPACT_ACT_GE_BYTEARRAY_ID);

SELECT * INTO TMPACT_ProcessInstance FROM ProcessInstance WHERE InstanceId IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);
SELECT * INTO TMPACT_ProcessErrorLog FROM ProcessErrorLog WHERE ProcessInstance IN (SELECT ID_ FROM TMPACT_HI_PROCINST_ID);
SELECT * INTO TMPACT_ProcessWaitStat FROM ProcessWaitStat WHERE InternalProcessId IN (SELECT ID_ FROM ACT_RU_EXECUTION);

DROP TABLE TMPACT_ACT_GE_BYTEARRAY_ID;
DROP TABLE TMPACT_HI_PROCINST_ID;

/* 03: constraints löschen */
ALTER TABLE ACT_RU_JOB DROP CONSTRAINT ACT_FK_JOB_EXCEPTION
ALTER TABLE ACT_RU_TIMER_JOB DROP CONSTRAINT ACT_FK_TIMER_JOB_EXCEPTION
ALTER TABLE ACT_RU_SUSPENDED_JOB DROP CONSTRAINT ACT_FK_SUSPENDED_JOB_EXCEPTION
ALTER TABLE ACT_RU_DEADLETTER_JOB DROP CONSTRAINT ACT_FK_DEADLETTER_JOB_EXCEPTION
ALTER TABLE ACT_RU_VARIABLE DROP CONSTRAINT ACT_FK_VAR_BYTEARRAY
ALTER TABLE ACT_RE_MODEL DROP CONSTRAINT ACT_FK_MODEL_SOURCE
ALTER TABLE ACT_RE_MODEL DROP CONSTRAINT ACT_FK_MODEL_SOURCE_EXTRA
ALTER TABLE ACT_PROCDEF_INFO DROP CONSTRAINT ACT_FK_INFO_JSON_BA;
ALTER TABLE ACT_GE_BYTEARRAY DROP CONSTRAINT ID_ACT_GE_BYTEARRAY
--Für ältere Versionen: Hier muss geprüft werden, welcher Name wirklich vergeben worden ist, da das Suffix generiert ist.
--ALTER TABLE ACT_GE_BYTEARRAY DROP CONSTRAINT PK__ACT_GE_B__XXXX

/* 04: Tabelle leeren */
TRUNCATE TABLE ACT_HI_PROCINST;
TRUNCATE TABLE ACT_HI_ACTINST;
TRUNCATE TABLE ACT_HI_TASKINST;
TRUNCATE TABLE ACT_HI_IDENTITYLINK;
TRUNCATE TABLE ACT_HI_VARINST;
TRUNCATE TABLE ACT_HI_DETAIL;
TRUNCATE TABLE ACT_GE_BYTEARRAY;
TRUNCATE TABLE ProcessInstance;
TRUNCATE TABLE ProcessErrorLog;
TRUNCATE TABLE ProcessWaitStat;

/* 05: gültige Daten zurückspielen */
INSERT INTO ACT_HI_PROCINST     select * from TMPACT_HI_PROCINST;
INSERT INTO ACT_HI_ACTINST      select * from TMPACT_HI_ACTINST;
INSERT INTO ACT_HI_TASKINST     select * from TMPACT_HI_TASKINST;
INSERT INTO ACT_HI_IDENTITYLINK select * from TMPACT_HI_IDENTITYLINK;
INSERT INTO ACT_HI_VARINST      select * from TMPACT_HI_VARINST;
INSERT INTO ACT_HI_DETAIL       select * from TMPACT_HI_DETAIL;
INSERT INTO ACT_GE_BYTEARRAY    select * from TMPACT_GE_BYTEARRAY;
INSERT INTO ProcessInstance    select * from TMPACT_ProcessInstance;
INSERT INTO ProcessErrorLog    select * from TMPACT_ProcessErrorLog;
INSERT INTO ProcessWaitStat    select * from TMPACT_ProcessWaitStat;

/* 06: Tmp Tabellen löschen */
DROP TABLE TMPACT_HI_PROCINST;
DROP TABLE TMPACT_HI_ACTINST;
DROP TABLE TMPACT_HI_TASKINST;
DROP TABLE TMPACT_HI_IDENTITYLINK;
DROP TABLE TMPACT_HI_VARINST;
DROP TABLE TMPACT_HI_DETAIL;
DROP TABLE TMPACT_GE_BYTEARRAY;
DROP TABLE TMPACT_ProcessInstance;
DROP TABLE TMPACT_ProcessErrorLog;
DROP TABLE TMPACT_ProcessWaitStat;

/* 07: constraints erstellen */
ALTER TABLE [dbo].[ACT_GE_BYTEARRAY] ADD CONSTRAINT [ID_ACT_GE_BYTEARRAY] PRIMARY KEY CLUSTERED ( [ID_] ASC )
  WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 70) ON [PRIMARY];
ALTER TABLE [dbo].[ACT_RU_JOB]  WITH NOCHECK ADD  CONSTRAINT [ACT_FK_JOB_EXCEPTION] FOREIGN KEY([EXCEPTION_STACK_ID_])
  REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_]);
ALTER TABLE [dbo].[ACT_RU_TIMER_JOB]  WITH NOCHECK ADD  CONSTRAINT [ACT_FK_TIMER_JOB_EXCEPTION] FOREIGN KEY([EXCEPTION_STACK_ID_])
  REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_]);
ALTER TABLE [dbo].[ACT_RU_SUSPENDED_JOB]  WITH NOCHECK ADD  CONSTRAINT [ACT_FK_SUSPENDED_JOB_EXCEPTION] FOREIGN KEY([EXCEPTION_STACK_ID_])
  REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_]);
ALTER TABLE [dbo].[ACT_RU_DEADLETTER_JOB]  WITH NOCHECK ADD  CONSTRAINT [ACT_FK_DEADLETTER_JOB_EXCEPTION] FOREIGN KEY([EXCEPTION_STACK_ID_])
  REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_]);
ALTER TABLE [dbo].[ACT_RU_VARIABLE]  WITH NOCHECK ADD  CONSTRAINT [ACT_FK_VAR_BYTEARRAY] FOREIGN KEY([BYTEARRAY_ID_])
  REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_]);
ALTER TABLE [dbo].[ACT_RE_MODEL]  WITH NOCHECK ADD  CONSTRAINT [ACT_FK_MODEL_SOURCE] FOREIGN KEY([EDITOR_SOURCE_VALUE_ID_])
  REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_]);
ALTER TABLE [dbo].[ACT_RE_MODEL]  WITH NOCHECK ADD  CONSTRAINT [ACT_FK_MODEL_SOURCE_EXTRA] FOREIGN KEY([EDITOR_SOURCE_EXTRA_VALUE_ID_])
  REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_]);
ALTER TABLE [dbo].[ACT_PROCDEF_INFO]  WITH NOCHECK ADD  CONSTRAINT [ACT_FK_INFO_JSON_BA] FOREIGN KEY([INFO_JSON_ID_])
  REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_]);

ALTER TABLE [dbo].[ACT_RU_JOB] NOCHECK CONSTRAINT [ACT_FK_JOB_EXCEPTION];
ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] NOCHECK CONSTRAINT [ACT_FK_TIMER_JOB_EXCEPTION];
ALTER TABLE [dbo].[ACT_RU_SUSPENDED_JOB] NOCHECK CONSTRAINT [ACT_FK_SUSPENDED_JOB_EXCEPTION];
ALTER TABLE [dbo].[ACT_RU_DEADLETTER_JOB] NOCHECK CONSTRAINT [ACT_FK_DEADLETTER_JOB_EXCEPTION];
ALTER TABLE [dbo].[ACT_RU_VARIABLE] NOCHECK CONSTRAINT [ACT_FK_VAR_BYTEARRAY];
ALTER TABLE [dbo].[ACT_RE_MODEL] NOCHECK CONSTRAINT [ACT_FK_MODEL_SOURCE];
ALTER TABLE [dbo].[ACT_RE_MODEL] NOCHECK CONSTRAINT [ACT_FK_MODEL_SOURCE_EXTRA];
ALTER TABLE [dbo].[ACT_PROCDEF_INFO] NOCHECK CONSTRAINT [ACT_FK_INFO_JSON_BA];

/* 08: constraints aktivieren */
/* Dieses Statement manuell ausführen und dann Ergebniszeilen als Skript ausführen */
SELECT 'ALTER TABLE ' + Table_name + ' CHECK CONSTRAINT ' + constraint_name + ';'
  FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
  WHERE Table_Name IN ('ACT_GE_BYTEARRAY','ACT_RE_DEPLOYMENT','ACT_RE_MODEL','ACT_RU_EXECUTION','ACT_RU_JOB','ACT_RU_TIMER_JOB','ACT_RU_SUSPENDED_JOB','ACT_RU_DEADLETTER_JOB','ACT_RE_PROCDEF','ACT_RU_TASK','ACT_RU_IDENTITYLINK','ACT_RU_VARIABLE','ACT_RU_EVENT_SUBSCR','ACT_EVT_LOG','ACT_PROCDEF_INFO','ACT_RU_INTEGRATION')
  AND CONSTRAINT_TYPE in ('FOREIGN KEY');



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.