Question & Answer
Question
How can I prevent the taskstats table from growing overly large with entries I don't want to track?
Cause
High volume systems can generate millions of entries into the taskstats table. Although maintenance routines can be created to delete these entries periodically, there are a couple of methods that can be used to prevent the entries from building up in the first place.
Answer
Tasks run by Taskmaster Client or Taskmaster Client Service (8.0.1.x only)
- Locate the Batch Pilot Project (BPP) file corresponding to the task currently writing entries into the taskstats table.
- Backup the BPP file and then open the original using Notepad or similar text editor.
- Add section [TaskStats] if it does not already exist.
- Under [TaskStats], add SkipTaskStatsOnStatus=x, where x is the status to avoid.
- 0 = Abort
- 1 = Canceled
- 2 = Finished
- 3 = Waiting
- 4 = Hold
- 5 = Suspended
- 8 = Pending
- Repeat step #4 as many times as necessary and then save the BPP.
Example:
In APT, edit rrs_VScan.bpp and add
[TaskStats]
SkipTaskStatsOnStatus=8
VScan tasks run by Taskmaster Client or Taskmaster Client Service will no longer post VScan tasks to the taskstats table when they finish with a status of Pending.
Tasks run by Rulerunner / Rulerunner Quattro or other clients
Inserts cannot be prevented with these clients, but a trigger can be created within SQL or Oracle to immediately delete the entry. For the above example, the trigger might look like the following:
Create Trigger on taskstats
AFTER insert AS
BEGIN
Delete from taskstats where new.ts_TaskName='VScan' AND new.ts_Status='pending'
END
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21575411