Automating deletion by rule

By default, new deletion rules are configured so that you can create deletion jobs manually. You can configure each rule so that deletion jobs are created automatically according to a schedule.

Before you begin

Running deletion-by-rule jobs on an automated basis requires the Db2® administrative task scheduler if you are using Db2, or the SQL Server Agent to be running if you are using SQL Server, or a third-party tool such as pg_cron if you are using PostgreSQL. For more information, see the i2® Analyze software prerequisites.

About this task

When you automate a deletion rule, it is included in a deletion job that is created by a scheduled task. i2 Analyze processes in sequence all the jobs that are in the queue whether created manually or automatically.

Note: Do not run a deletion job while data is being ingested into the Information Store. For more information about the deletion-by-rule job schedule, see Changing the automated job creation schedule.

To automate a rule in Db2 or SQL Server, complete the following steps:

Procedure

  • Connect to your database as a user with the Deletion_By_Rule role.
  • Run the IS_Public.Automate_Deletion_Rule stored procedure and enter the name of the rule.
    The automated flag for the rule is changed from N to Y.
  • To view the rule details and confirm an automated setting, browse the data in the IS_Public.Deletion_Rules view.

Alternatively, to automate a rule in PostgreSQL, complete these steps:

  • Download a third-party scheduling agent such as pg_cron.
  • Use the agent to call the IS_Public.Automate_Deletion_Rule function on a schedule.

Results

At the time when automated deletion by rule is scheduled, a job is created for each rule that is set to automated. Each job is queued and runs in sequence.

You can check the status of the job in the IS_Public.Deletion_By_Rule_Log view. For more information, see Verifying deletion by rule.

What to do next

You can configure the schedule for deletion-by-rule job creation according to your requirements. For more information, see Changing the automated job creation schedule.

To disable automated deletion for a rule, either run the IS_Public.Disable_Deletion_Rule procedure and enter the rule name (Db2 and SQL Server), or remove the call to the IS_Public.Automate_Deletion_Rule function from the agent (PostgreSQL).