If you've been using geodatabase archiving for a while or take data offline and you frequently edit your archive-enabled tables and feature classes, your archive tables will grow over time as edits are maintained.
Large archive tables can impact decisions about storage and backup management and may affect performance if the data outgrows the system. Some organizations may use nonversioned archiving because it is required for certain functionality, though they have no need for historical records. Other organizations may only be interested in recent history and may want to trim records older than a specific age or trim the archived history of data changes that are no longer relevant.
Trim Archive History tool
To decrease the size of these tables, you can use the Trim Archive History geoprocessing to delete retired rows from nonversioned archived datasets without disabling archiving or disrupting sync workflows in your enterprise geodatabase.
Requirements
When preparing to use the Trim Archive History geoprocessing tool, consider the following:
- This tool is only supported with nonversioned archived datasets.
- To run this tool, you must be connected to the geodatabase as the data owner.
- This tool only supports datasets that are stored in an enterprise geodatabase. The following are supported databases:
- IBM Db2
- Microsoft SQL Server
- Oracle
- PostgreSQL
Work with related data
The Trim Archive History geoprocessing tool only allows a single dataset to be specified for the input. If the input dataset participates in a relationship with any other dataset, the input dataset and all related tables are trimmed using the same setting (for example, all retired rows or retired rows by input date).
Work with replicated data
The Trim Archive History geoprocessing tool honors replica sync moments. If the input table or any related tables are referenced by a replica, then the input trim date must be older than the last sync date of any referenced replica. If the input trim date is more recent than the last sync date, then the Trim Archive History geoprocessing tool will fail citing the replica name and the last sync date in coordinated universal time (UTC). Leaving the input trim date empty is the same as inputting the current date & time.
If any replica is preventing the trim archive operation from happening, then you must either input a more recent date or unregister the replica using the Unregister Replica geoprocessing tool. Replica information can be obtained from either the Manage Replicas pane in ArcGIS Pro or for feature service based replica, then from the feature service you can get the list of replicas using the Replicas (Feature Service). Only unregister replicas that will no longer be used. Once a replica has been unregistered, it cannot be used again to synchronize edits.
Trim the archive history
Complete the following steps to delete retired rows from a dataset using the Trim Archive History geoprocessing tool:
- In ArcGIS Pro, in the Geoprocessing pane, search for the Trim Archive History geoprocessing tool.
The Trim Archive History dialog box appears.
- For Input Table, use the browse button to add a nonversioned archived dataset from which you want to trim archived rows. You can use the drop-down menu to add any nonversioned archive-enabled datasets that are in the map.
Caution:
- The input table must be archive enabled.
- The input table must be nonversioned. Versioned tables are not supported.
- For Trim Mode, choose Delete to trim the archive history.
Note:
At ArcGIS Pro 2.6, Delete is the only option for Trim Mode.
- Optionally, provide a value for Trim Before Date. The following options are available:
- If the input Trim Before Date is left empty, the tool will attempt to delete all retired rows, and if any of the rows are referenced by a replica that has not already synced those rows, the operation will fail.
- If the input Trim Before Date is populated with some value, the tool will attempt to delete retired rows that are older than the input date. If the retired rows are referenced by a replica that has not already synced those rows, you must input an earlier trim before date or unregister the replica.
Caution:
Archiving nonversioned data uses UTC to represent time; therefore, the Trim Before Date value must also be in a UTC time stamp format.
For example, if a feature is created at 3:30 p.m. on 4/24/2020 EDT, the GDB_FROM_DATE field records 2020-04-24 19:30:00, which is the date and time of the edit represented in UTC, not the date and time of the machine.
Review the trimmed archive history
If the input dataset or related datasets have no rows to trim, the Trim Archive History tool will successfully complete and return a warning for any tables that had no rows trimmed. Once the trim completes, you can access the last trimmed date of a dataset on the Source tab on the feature class or table properties dialog box. In addition, on the Source tab, you can also see the Archiving property with the data and time (UTC) archiving was enabled and the Archive Name property is populated.