Issue
The Table Cleaner feature can be used to delete unwanted data in your ServiceNow instance. This article will assist in creating a new Table Cleaner. The process is designed not to impact performance as it deletes the data in batches/chunks.
This currently applies to only instances running with MySQL/MariaDB database.
NOTE: Table Cleaner cannot be used for sharded tables, table rotation, or table extension.
Resolution
The following instructions outline the creation of a new Table Cleaner:
- In the Navigator filter, type: sys_auto_flush_list.do
- Click on New and a screen will be displayed as per the following attached screenshot
- Based upon the clean up requirements fill in the following fields accordingly
-
- Table Name - Identify Table Name to be cleaned
- Matchfield - Field based on which records will be cleaned e.g. sys_created_on
- Age in seconds - How old records to be deleted - Enter the number in seconds - 2592000 for 30 days old records. Enter 0 in seconds if you want to delete all the records for specified condition as specified in Conditions
- Active - Check the checkbox to active
- Application - This will be greyed out
- Cascade delete – Check the checkbox to delete cascade relationships to the table
- Conditions - Add the specified filter condition or do not add it if all the records related of certain age needs to be deleted as specified in Age in seconds
-
- Click Submit and the record will be created. On the next execution of the Table Cleaner job this new rule will be executed