How To: Determine if there are orphaned replica system versions in the geodatabase
Cases may arise where internal replica versions become orphaned in the geodatabase, resulting in a less than optimal geodatabase compress.
Instructions provided describe how to identify these versions and delete the orphaned versions.
Note: This article pertains to ArcGIS versions 9.x through 10.2.x. Later versions of ArcGIS may contain different functionality, as well as different names and locations for menus, commands and geoprocessing tools. See the GeoNet post, Orphaned Replica Versions in 10.2.2.
Replica system versions are versions that are used behind the scenes by ArcGIS to determine the changes to synchronize for a replica. A set of system versions exists for each replica in the geodatabase. Various system versions are created and deleted by ArcGIS as the replicas are synchronized.
These versions are hidden by design, which means they are not displayed in ArcGIS and not returned by ArcObjects. They should not be manually deleted from the ArcSDE repository.
The replica system versions can be identified by the way they are named. The naming conventions for the replica system versions are as follows:
Two-way and one-way replicas:
- SYNC_RECEIVE_<replica id>_<generation number>
- SYNC_RECEIVE_REC_<replica id>_<generation number>
- SYNC_SEND_<replica id>_<generation number>
There may be instances where replicas are unregistered and their replica system versions remain in the geodatabase. These versions may cause a less effective compress than if the versions were not orphaned in the geodatabase. The following steps describe how to identify and remove these orphaned versions.
- Query the GDB tables to list all replica IDs:
Versions 10.0 and higher:
After version 10.0 with the simplified geodatabase tables, the following command can be used to query for replica names. The OBJECTID for the replicas returned from the GDB_ITEMS table can be associated with the numeric portion of the system replica version name in the versions table.
Note: Please note the GDB_ITEMS table is qualified with sde as the owner in this example and may need to be changed to DBO for certain SQL Server DBO schema geodatabases.
SELECT ObjectID, name from sde.GDB_ITEMS where TYPE='4ED4A58E-621F-4043-95ED-850FBA45FCBC'; ObjectID Name -------------------- 47 to_tucker 49 Carolina
Connect to the database as the sde or repository owner by way of SQL and run the following query to list the existing replicas along with their replica IDs:
SELECT id, name from sde.gdb_replicas;
ID NAME ---------- 57 rep_1way 56 rep_2way
- Query the versions (sde_versions for SQL Server) table to list all existing versions:
SQL> select name from sde.versions order by name;
NAME ---------------------------------- DEFAULT SYNC_RECEIVE_47_0 SYNC_RECEIVE_47_1 SYNC_RECEIVE_49_2 SYNC_RECEIVE_REC_49_2
- After identifying orphan replica versions by their OBJECTID value within the GDB_ITEMS table delete these versions.
The 'Delete Version' Data Management tool can be used to delete the orphaned version by manually typing the replica version name in the tool.
Note: The sdeversion -o delete command can be used in versions previous to 10.3 if installed.
Warning: A full backup should always be taken prior to using troubleshooting steps in this article. No other replica system versions should be deleted from the geodatabase, as this can lead to corruption of the existing replicas.Please contact Esri Support Services if workflows are found where orphaned replica versions are a result or if there are any questions related to this workflow prior to deleting replica system versions.