- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 05:59 PM
I have a use case where I need to delete a large number of records from the em_alert table.
Does anyone have script or safe way to do this?
Solved! Go to Solution.
- Labels:
-
Event Management
-
Orchestration (ITOM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:26 PM - edited 05-07-2024 09:58 PM
Hi @Sam Johnson1 ,
Navigate: Automated Test Framework > Administration > Table Cleanup
- Click New
- Tablename: <table to delete records>
- Age in seconds: 1 day's worth of seconds (60x60x24 = 86400) or a week or whatever you want to keep
- Cascade delete: true (that way it will clean up other data)
- Then there are more conditions you can add.
- Click Submit
Let the scheduled job Table Cleaner run it's schedule. To check and verify there is a scheduled job.
Navigate: System Scheduler > Scheduled Jobs
- Search Name: Table Cleaner
*Note the Next Action Date/Time
If the scheduled job does not exist - create a new job to repeat every hour, but this is an OOB job and should exist.
Once the scheduled job has run and completed - DELETE THE TABLE CLEANUP you created. If not, you will continually delete the records from the table.
Reference- https://www.youtube.com/watch?v=7hCx--uDgws
Servicenow KB article - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694151
If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:26 PM - edited 05-07-2024 09:58 PM
Hi @Sam Johnson1 ,
Navigate: Automated Test Framework > Administration > Table Cleanup
- Click New
- Tablename: <table to delete records>
- Age in seconds: 1 day's worth of seconds (60x60x24 = 86400) or a week or whatever you want to keep
- Cascade delete: true (that way it will clean up other data)
- Then there are more conditions you can add.
- Click Submit
Let the scheduled job Table Cleaner run it's schedule. To check and verify there is a scheduled job.
Navigate: System Scheduler > Scheduled Jobs
- Search Name: Table Cleaner
*Note the Next Action Date/Time
If the scheduled job does not exist - create a new job to repeat every hour, but this is an OOB job and should exist.
Once the scheduled job has run and completed - DELETE THE TABLE CLEANUP you created. If not, you will continually delete the records from the table.
Reference- https://www.youtube.com/watch?v=7hCx--uDgws
Servicenow KB article - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694151
If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 10:00 PM
I think it's done by default.