Need to clean up the records in cert_audit_result table

valuroutu
Tera Contributor

Hi Everyone,

I have a requirement as to clean the records in the table 'cert_audit_result', firstly I couldn't even access the records in the table as it is containing many records.

Even the instance goes down while typing the audit results table.

Any leads can be of great help to me!

Thanks in advance!

Krishna

4 REPLIES 4

Kalaiarasan Pus
Giga Sage

Contacting ServiceNow support is not a bad idea.

Kalaiarasan Pus
Giga Sage

And if you do not want to do that for some reason, you can just open the table with only filter with no records in the display by using the below URL

 

instance/tablename_list.do?sysparm_view=&sysparm_filter_only=true&sysparm_query=null

 

This will just pop up the filter of the table and you can filter subset of data using any condition such as created this month, etc

valuroutu
Tera Contributor

Hi Kalai,

Thanks for the response!

As per your suggestion, I can access the table with no records now. Do you have any other idea for cleaning up the records in this table other than contacting the servicenow support?

Regards!

Krishna

kethineni
Giga Contributor

I use a fix script to clean up my audit table:

 

var auditGR = new GlideRecord('cert_audit_result');
auditGR.addEncodedQuery("auditLIKELinux");
auditGR.query();


auditGR.setWorkflow(false); //Turn off business rule or notifications
gs.print("pru.cert.remove_audit_results : the count is " + auditGR.getRowCount());
auditGR.deleteMultiple();