Is there a simple way to purge cmdb_ci_computer?

tchaikin
Giga Expert

Does anyone have a shortcut/quick and easy way to purge a table in CMDB? I am trying to purge cmdb_ci_computer (in a non-Production instance) and it is hitting a timeout if I do it from the front-end.

I have tried:

- Deleting all records in the table through a background script. Result: Ran for over an hour before I cancelled it and deleted only a handful.

- Deleting records from the list view. Result: Timed out, deleted only a few

- Deleting records from the table definition (using the Delete all records) button. Result: Timed out, deleted only a few

I think the problem is that we have a number of linked records on every computer record (installed software, hard disk(s), network adapters), and the cascade deletion is taking forever.

Any help would be most appreciated.

Thanks,

Todd

 

1 ACCEPTED SOLUTION

Nitesh Balusu
Giga Guru

The reason this is happening is due to something called:

Transaction quotas

 

The best practice to delete large number of records in a table is using a scheduled job, or deleting small chunks of records at a time.

Scheduled job is the best method as transaction quotas don't apply to this as it does the job in the background and does the job over a period of time.

View solution in original post

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

I would go for a Background script. Even if the scripts takes, time, dont cancel the transaction. It keeps deleting the records in background. Keep refreshing the computer table and check the count after running the background script


Please mark this response as correct or helpful if it assisted you with your question.

Nitesh Balusu
Giga Guru

The reason this is happening is due to something called:

Transaction quotas

 

The best practice to delete large number of records in a table is using a scheduled job, or deleting small chunks of records at a time.

Scheduled job is the best method as transaction quotas don't apply to this as it does the job in the background and does the job over a period of time.

Thanks, I elected to go with the Scheduled Job option as suggested. It's getting through it slowly.