# Job scheduler to schedule truncates in database

**URL:** <https://forums.pega.com/t/job-scheduler-to-schedule-truncates-in-database/6476>\
**Category:** General\
**Tags:** insurance, team-lead, dev-designer-studio, 8-6-6, system-architect\
**Created:** [March 21, 2024, 5:47pm UTC](https://forums.pega.com/t/job-scheduler-to-schedule-truncates-in-database/6476 "2024-03-21T17:47:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GabrielM16837471](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@GabrielM16837471](https://forums.pega.com/u/GabrielM16837471)\
**Post date:** [March 21, 2024, 5:47pm UTC](https://forums.pega.com/t/job-scheduler-to-schedule-truncates-in-database/6476/1 "2024-03-21T17:47:55Z")

</div>

Hi, guys.

Can I create a Job Scheduler, Queue Processor etc. to truncate those tables below periodically? If not, has any other way to do this through Pega instead of database directly?

PEGADATA.pr\_sys\_queue\_ftsindexer;  
PEGADATA.pr\_sys\_queues;  
PEGADATA.pr\_log;  
PEGADATA.pc\_history\_work;  
PEGARULES.pr\_sys\_cache\_entry;  
PEGARULES.pr\_sys\_cache\_dep;  
PEGARULES.pr\_sys\_cache\_impl;  
PEGARULES.pr\_sys\_appcache\_dep;  
PEGARULES.pr\_sys\_appcache\_entry;  
PEGARULES.pr\_sys\_appcache\_shortcut;  
PEGARULES.pr\_sys\_rule\_impl;  
PEGARULES.pr4\_rule\_sysgen;  
PEGARULES.pr\_assembledclasses;  
PEGADATA.pr\_sys\_updatescache;  
PEGADATA.pr\_sys\_statusnodes;  
PEGADATA.pr\_sys\_statusdetails;

Thanks.

---

<div class="post-metadata">

**Author:** ![RameshSangili](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/rameshsangili/32/23377_2.png) [@RameshSangili](https://forums.pega.com/u/RameshSangili)\
**Post date:** [March 21, 2024, 6:24pm UTC](https://forums.pega.com/t/job-scheduler-to-schedule-truncates-in-database/6476/2 "2024-03-21T18:24:57Z")

</div>

@GabrielM16837471

I recommended you trigger the job scheduler to run periodically to clean up the tables. However, I am concerned about deleting the tables you listed because those are OOTB tables, so I request you double-check the impacts before cleaning them up.

pc\_work\_history - Audit information on the case will be lost once you delete it.

pr\_sys\_queues - SLA entries will be deleted ( this may result in inconsistency on the case workflow because SLA’s won’t be triggered once deleted)

---

<div class="post-metadata">

**Author:** ![GabrielM16837471](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@GabrielM16837471](https://forums.pega.com/u/GabrielM16837471)\
**Post date:** [March 22, 2024, 5:39pm UTC](https://forums.pega.com/t/job-scheduler-to-schedule-truncates-in-database/6476/3 "2024-03-22T17:39:01Z")

</div>

@RameshSangili

Ri, Ramesh. Thanks for your reply.

Pega recommended us to truncate those tables to solution two INCs:

- Slowness in devlopment environment;

- Some buttons showing the wrong label

This would be done only in devlopment and homologation environment.

How can i create a Job Scheduler to do this?

---

<div class="post-metadata">

**Author:** ![RameshSangili](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/rameshsangili/32/23377_2.png) [@RameshSangili](https://forums.pega.com/u/RameshSangili)\
**Post date:** [March 22, 2024, 6:03pm UTC](https://forums.pega.com/t/job-scheduler-to-schedule-truncates-in-database/6476/4 "2024-03-22T18:03:36Z")

</div>

@GabrielM16837471

Please go through Pega Academy course

> **[Creating a Job Scheduler rule | Pega Academy](https://academy.pega.com/topic/creating-job-scheduler-rule/v2)**

It would be great if your DBA or Cloud team could execute it with scheduled jobs since it requires deleting rows in multiple tables.

---

<div class="post-metadata">

**Author:** ![GabrielM16837471](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@GabrielM16837471](https://forums.pega.com/u/GabrielM16837471)\
**Post date:** [March 26, 2024, 5:09pm UTC](https://forums.pega.com/t/job-scheduler-to-schedule-truncates-in-database/6476/5 "2024-03-26T17:09:18Z")

</div>

@RameshSangili, hi.

I will try this solution. Thank you so much.
