Database size is increasing while removing data from the table cmdb_rel_ci

madhanrajesh
Tera Contributor

"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?"

9 REPLIES 9

Nilesh Pol
Tera Guru

Hi @madhanrajesh 

You can make use following line in your script to to perform deletions and selectively manage the logging process.

GlideAudit.setAuditing(false);

 

its not working @Nilesh Pol  thanks for helping.

Dominik Simunek
Tera Guru

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.

It's not working @Dominik Simunek thanks for helping.