There are several transactions that you can use to purge your database tables at specific time intervals.
Purge transactions determine when a table should be purged by determining the current date and subtracting the retention days specified by the purge. If the timestamp on the table is less than or equal to (current day - retention days) the table is purged.
Note: In some cases a purge may look at another field other than the table’s timestamp. These are pointed out in the documentation.
Note: When purging an entity, take into consideration all of the information that is purged along with it. For example, if a sales order with live shipments is purged, the order does not appear in the order number field in the Outbound Shipment Console.