Use this task to solve problems with the Business Process Choreographer database and data source.
select count(*) from process_instance_b_t with ur
By specifying with UR, locking is avoided, which
could affect other users of the database.select count(*) from activity_instance_b_t with ur
SELECT
PI.PIID, PT.NAME, PI.STATE, COUNT(AI.AIID) AS NUMBER_OF_ACTIVITIES
FROM
ACTIVITY_INSTANCE_B_T AS AI,
PROCESS_INSTANCE_B_T AS PI,
PROCESS_TEMPLATE_B_T AS PT
WHERE
PI.PTID = PT.PTID AND
AI.PIID = PI.PIID
GROUP BY
PI.PIID, PT.NAME, PI.STATE
ORDER BY
NUMBER_OF_ACTIVITIES DESC
FETCH FIRST 20 ROWS ONLY
WITH UR
where PI.PIID is the process instance
ID from the process_instance_b_t table and PT.NAME is the name of the process template. This query
might result in output similar to the following:PIID NAME STATE NUMBER_OF_ACTIVITIES
----------------------------------- ---------- ------ --------------------
x'9003011CE5DED75B3EFDEB538C02DAE4' claimWork 6 147047
x'9003011E841DE9AF3EFDEB53045C4103' claimWork 6 96609
x'9003011E841DDEF13EFDEB53045C3DD9' claimWork 6 96462
...
In this example, the claimWork process template has the most activities in the database. For process
instances, the state, 6, indicates that they are
in the state TERMINATED. If the database is filling
up with such instances, you should consider setting the property for
automatic deletion in the model, configuring the cleanup service and
cleanup jobs to periodically delete eligible instances, or running
a script to delete completed instances. These and other techniques
for reducing the size of the database are described in Cleanup procedures for Business Process Choreographer.select count(*) from process_instance_b_t where state = processState with ur
where processState is one of the following integer values representing the state of
the process instance:0 = DELETED
1 = READY
2 = RUNNING
3 = FINISHED
4 = COMPENSATING
5 = FAILED
6 = TERMINATED
7 = COMPENSATED
8 = TERMINATING
9 = FAILING
10 = INDOUBT
11 = SUSPENDED
12 = COMPENSATION_FAILED
select count(*) from activity_instance_b_t where state = activityState with ur
where activityState is one of the following integer values representing the state of
the activity instance:1 = INACTIVE
2 = READY
3 = RUNNING
4 = SKIPPED
5 = FINISHED
6 = FAILED
7 = TERMINATED
8 = CLAIMED
9 = TERMINATING
10 = FAILING
11 = WAITING
12 = EXPIRED
13 = STOPPED
14 = PROCESSING_UNDO
SELECT
AI.LAST_STATE_CHANGE, ATP.NAME, AI.STATE
FROM
ACTIVITY_INSTANCE_B_T AI,
ACTIVITY_TEMPLATE_B_T ATP
WHERE
AI.ATID = ATP.ATID and
AI.PIID = '9003011CE5DED75B3EFDEB538C02DAE4'
ORDER BY
AI.LAST_STATE_CHANGE DESC
FETCH FIRST 40 ROWS ONLY
WITH UR
This query might result in output similar to the
following:LAST_STATE_CHANGE NAME STATE
----------------------- ------------- -------
2011-03-22-16.24.17.964333 Activity_17 7
2011-03-22-16.23.55.925757 Activity_14 5
2011-03-22-16.23.32.528576 Activity_14 5
2011-03-22-16.23.11.976875 Activity_14 5
2011-03-22-16.22.49.582347 Activity_14 5
2011-03-22-16.22.24.257894 Activity_14 5
2011-03-22-16.22.01.723894 Activity_14 5
...
In this example, multiple instances of activity 14
are changing to the state FINISHED per second. Comparing
this information with your knowledge about the process and how you
expect it to behave, this might indicate an unintended loop that needs
to be corrected in the model.2004-06-25-15.53.42.078000 Instance:DB2 Node:000
PID:2352(db2syscs.exe) TID:4360 Appid:*LOCAL.DB2.027785142343
data management sqldEscalateLocks Probe:4 Database:BPEDB
ADM5503E The escalation of "10" locks on table "GRAALFS .ACTIVITY_INSTANCE_T"
to lock intent "X" has failed. The SQLCODE is "-911"
Increase the LOCKLIST value. For example to set
the value to 500, enter the following DB2 command: db2 UPDATE DB CFG FOR BPEDB USING LOCKLIST 500
This can improve performance significantly.