Database size is increasing while removing data from the table cmdb_rel_ci
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2025 09:56 PM - edited ‎02-26-2025 10:07 PM
"We are supposed to delete 10 lakh records per day (since we have 10Cr+ unwanted data) from the cmdb_rel_ci table, but this is generating a large number of entries in sys_audit_relation, sys_audit, and sys_audit_delete tables approximately 3 times the count of deleted records. Specifically, deleting a single record from cmdb_rel_ci results in 2 entries in sys_audit_relation, 1 entry in sys_audit, and 1 entry in sys_audit_delete. How can we optimize or prevent this excessive logging while performing deletions?"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2025 10:13 PM
You can make use following line in your script to to perform deletions and selectively manage the logging process.
GlideAudit.setAuditing(false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 12:35 AM
its not working @Nilesh Pol thanks for helping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 12:06 AM
You can test running deletion with setWorkflow(false) on the GlideRecord. That typically turns off auditing as well. In case, there is nothing else dependent on the delete action of cmdb_rel_ci (like some cascaded deletes), it might be safe to turn it off.
Also be aware that temporarily big deletions done with "Rollback enabled" will also increase db size for couple of days until the rollback context is obsolete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 12:36 AM
It's not working @Dominik Simunek thanks for helping.