This article is meant to help clarify how to use 'Table Cleaner' to delete unwanted data in ServiceNow.
Table cleaner does not impact performance as it cleans the data in batches.
This currently applies to only instances running with MySQL/MariaDB database and cannot be used for sharded tables of table rotation and table extension.
The following instructions outline the creation of a new 'Table Cleaner'
- Navigate to 'System Maintenance > Table Cleanup' (These are labelled as Auto Flushes)
- 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 check box 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