Select to view content in your preferred language

Prune Branch History not deleting records.

41
1
5 hours ago
Labels (3)
BGEGIS
by
Occasional Contributor

Hello everyone!

The tool in question: Prune Branch History (Data Management) 

Versions:
Pro - 3.5.3
Server - 11.5.0

Trying to use the Prune Branch History tool to remove test data from a dataset. This inspections table is related to a feature that is part of a Utility Network dataset. The inspection table and the Utility Network were published as a group and are housed in the same SDE. All test Inspections have been deleted from all versions. 

When running the tool there are no errors displayed, but the records are still contained in the archive table. In fact, the logs read as below when selecting the different options available.

REPORT ONLY LOG

[10/6/2025 2:39:17 PM] Prune moment: 10/6/2025 7:39:16.980 PM
[10/6/2025 2:39:17 PM] Reporting how many rows would be pruned from each table.
[10/6/2025 2:39:17 PM] Would prune 22 rows from MUD.HCMUD434_Inspections_Sanitary_Manhole_Table
[10/6/2025 2:39:20 PM] Would prune 2 rows from MUD.HCMUD434_Inspections_Sanitary_Manhole_Table__ATTACH

ONLY PRUNE SYSTEM TABLES LOG

[10/6/2025 2:42:52 PM] Prune moment: 10/6/2025 7:42:52.283 PM

BOTH

[10/6/2025 2:41:16 PM] Prune moment: 10/6/2025 7:41:15.733 PM
[10/6/2025 2:41:16 PM] Reporting how many rows would be pruned from each table.

 

There is a view that returns only the most recent Inspection Record for each point that is causing the issues for me. In this view I can still see all records including deleted records. I have tried filtering out the table by the GDB_IS_DELETE, but not all of the deleted records have GDB_IS_DELETE = 1 (some are 0). My current fix is janky at best and is just filtering out the deleted records from the view using GDB_ARCHIVE_OID > xy.

Here is a list of the archive table fields and their contents:
GDB_ARCHIVE_OID - OIDs (current work around is to filter lowest values out)
GDB_FROM_DATE - Date/Times (All have values)
GDB_IS_DELETE - Not all deleted records match, there is a mix of 0s and 1s
GDB_BRANCH_ID - all equal 0
GDB_DELETED_AT - some have the time/date some are null
GDB_DELETED_BY - some have the usernames some are null

Maybe it is a problem with how the table was triggered when the deleted occurred because all of the "GDB_IS_DELETE", "GDB_DELETED_AT", and the "GDB_DELETED_BY" should have values that are exactly the same.

Thanks so much for looking into this with me!!

Esri Community posting of a similar issue -

Solved: Prune Branch History Not Working - Esri Community 

How can I prune a Branch Versioned featureclass? - Esri Community

Best,
Scott F

Tags (3)
0 Kudos
1 Reply
RobertKrisher
Esri Regular Contributor

There is no OOTB view for viewing branch versioned data, and you shouldn't be using a dynamic view. Make sure you read this branch versioning article and a description of the SQL to view branch versioned data to make sure the 'view' is correct.  There's also this presentation about how the branch versioning and the SQL works.

In terms of pruning. If you have outstanding versions that haven't been reconciled, or contain conflicts, the prune tool cannot prune those edits because they will cause inconsistencies for those historical moments. Learn more about this in the Prune branch history—ArcGIS Pro | Documentation page and the Branch history—ArcGIS Pro | Documentation page.

0 Kudos