- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 11-14-2023 03:21 AM
You should read this article if :
- You are an admin
- You want to understand if Table Cleaner is working well and if something might be stuck
What is Table Cleaner?
- Table cleaner deletes older records automatically and prevents data from growing exponentially.
- Table cleaner is a scheduled job that runs once per hour to delete older, expired, or unwanted records from tables
- Table cleaner prevents tables from growing to an unmanageable size and improves query performance.
- Best is to check on already available resources :
- https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694151
- https://docs.servicenow.com/bundle/vancouver-platform-administration/page/administer/managing-data/c...
- https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0780777
- https://www.servicenow.com/community/now-platform-articles/demystifying-table-rotation-extension-and...
How to debug Table Cleaner?
- Sadfuly OOB logs are not very easy to read. You can :
- Look sys_auto_flush table for definitions
- Look sys_auto_flush_run table for duration of last runs, and when it runned last time
- Look syslog for duration of last runs, and when it runned last time
- Look transactions logs to check if Table Cleaner runned, when, and for how long
- Look sys_trigger to see if the job is running or nor
- My tool in allows to do the same, but in an easy way
How to use the Tool
- I created a menu to access the UI page :
Example part 1 : sys_auto_flush Definitions
- To check the Table Cleaner Configuration
- On this example you can see :
- cmdb_metric : Definition is configured to delete data in a table that doesn't exist (it will be ignored)
- All defincitions : Query time seems OK
- em_impact_graph : Cleanup of this table is possibly late (please note it can be normal as the job runs every hour only)
Example part 2 : Schedule Jobs
- To check if Table Cleaner did run properly
- Example 1 : All is very fast
- Example 2 : OK, but long :
- Example 3 : Job took a long time to run, it is not normal
- Job will be late, impact on performance may occur
Example part 3 : Tables taking a lot of time to clean, from Logs
- To check if Table Cleaner did have enough time to clean the tables
- On the following example, we can see em_impact_graph is very long to process :
How to deploy
- As an admin, download and install the attached Update Set on your instance :
- Download
- Navigate to System Update Sets > Retrieved Update Sets.
- Click the Import Update Set from XML link
- Select the downloaded file and Upload
- Open the Update Set
- Click Preview Update Set
- Click Commit Update Set
- Reload the menus, it is possible that you have to relog to see it
Example of typical findings you might spot
- Issue : Table Cleaner rule that is querying an index attribute
- Possible solutions : change indexes, change query, reduce time window to clean, find alternative ways to clean, remove auditing (removed data can be saved, slowing a lot the process)
- Issue : Table clean definition table or query is wrong
- Issue : A defintion is not cleaning as an other is taking all the time
- 2,554 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Benoit Crestey this is very helpful!
Within HR Service Delivery, we are required to retain certain records where there is a legal hold, captured in a true/false flag that sits in our HR Profile (direct feed from our HR system). Currently, our table cleaner for User Profiles does not pick up this legal hold flag. We will be going back to development of table cleaner to determine how to skip records that have legal hold in HR Profile.
Any other organizations have done this work to ensure that legal hold is skipped from table cleaner?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello @Benoit Crestey
Thank you for the article.
Just a query, Will the cascade delete option override the effects of disabling the 'Clean Peripheral' functionality.?
Meaning if I uncheck clean peripheral to keep my attachments and if I check cascade delete, my attachments still get deleted?
Kind Regards,
Ravi