Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Use the Pega-RULES agent to purge selected database tables regularly

Updated on September 13, 2021


A system administrator asks: Upon reviewing the space being used by various tables in the PegaRULES database, we noticed that the following tables were large.

Can you provide some guidelines on purging these tables periodically for space management? Should they be purged? What is the recommended time frame? What are the recommended selection criteria?

  • PR_LOG




Suggested Approach

Caution: In general, do not use native SQL operations to purge PegaRULES database tables, as the related Index- records may then contain dangling references to rows that have been deleted, and other database integrity requirements may be broken. Rather, follow the guidance below or advice from Global Customer Support.


PegaRULES Agent

The PegaRULES agent, one of three standard agents in every Process Commander system, ordinarily trims rows from certain tables, including the PR_LOG table, on a scheduled basis.

As a first step, confirm that this agent is running regularly and the activity that performs the purging is enabled.  To do this:

  1. Access the Rules by Type Explorer. Select SysAdmin > Agent Schedule to list Data-Agent-Queue instances.
  2. Review the Data-Agent-Queue instance named Pega-RULES. 
  3. On the Schedule tab, confirm that the agent-wide Enabled check box is checked, and that the row containing the System-Cleaner activity is enabled.  (In a multimode system, the agent needs to be enabled on only one node.) Update the check boxes and save the form if necessary.
  4. This agent normally runs every 86,400 seconds (once a day); you can choose a higher or lower frequency. 
  5. Then, use the System Console (prMonitorServlet) to confirm that the agent is running and not failing.

Application Agents

To purge tables other than those purged by the PegaRULES agent, create an agent in your application RuleSet, following these steps:.

  1. The standard activity Code-.SystemCleaner calls Log-.TrimLog to purge older records from specific tables. Create an activity or activities similar to Log-.TrimLog that selects and deletes the rows of the desired table(s), being careful about dependencies and relationships among database records.

  1. Create an activity (similar to Code-.SystemCleaner) that calls the activities you created in Step 1.
  1. Create a Rule-Agent-Queue instance named with your application RuleSet that calls the activity created in Step 2.  Choose a schedule for this activity.  In the Access Group field, choose an access group that provides all the application RuleSets needed to the agent.
  1. Before you can enable the new agent, there must exist a Data-Agent-Queue instance (on one node) with the same name as the Rule-Agent-Queue rule.  NOTE: Data-Agent-Queue instances are automatically created when a new Rule-Agent-Queue record is added and the agent manager recognizes the new agent. In a multinode system, update the Data-Agent-Queue records created by the agent manager to enable the queue on only one node.

Use the System Console to confirm that the new agent is running as scheduled.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us