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 and delete these orphaned versions.
Replica system versions 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.
Replica system versions can be identified by the way they are named. Naming conventions for 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 orphaned versions may cause a less than effective compress of the geodatabase.
The following steps describe how to identify and remove these orphaned versions.
- Connect to the database as the sde or repository owner using database interface tools and run the following query to list the existing replicas along with their replica IDs.
For SQL Server, if using a dbo schema database, alter the syntax below to reflect dbo.GDB_ITEMS and dbo.GDB_ITEMTYPES.
ITEMS.Definition .value( '(/GPReplica/ID)', 'nvarchar(max)') AS "ID" ,
ITEMS.Definition .value( '(/GPReplica/Name)', 'nvarchar(max)') AS "Replica Name" ,
ITEMS.Definition .value( '(/GPReplica/ReplicaVersion)', 'nvarchar(max)') AS "Replica Version" ,
ITEMS.Definition .value( '(/GPReplica/CreationDate)', 'nvarchar(max)') AS "Creation Date"
sde.GDB_ITEMS AS ITEMS INNER JOIN sde.GDB_ITEMTYPES AS ITEMTYPES
ON ITEMS .Type = ITEMTYPES .UUID
ITEMTYPES. Name = 'Replica';
Configure the Oracle EXTPROC in order to successfully execute the following SQL syntax.
SELECT EXTRACTVALUE(XMLType(Definition), '/GPReplica/Name') AS "Replica Names",
EXTRACTVALUE(XMLType(Definition), '/GPReplica/ID') AS "ReplicaID"
FROM sde.GDB_ITEMS_VW ITEMS INNER JOIN sde.GDB_ITEMTYPES ITEMTYPES
ON ITEMS.Type = ITEMTYPES.UUID WHERE ITEMTYPES.Name = 'Replica';
- Query the versions table (sde_versions for SQL Server) to list all existing versions:
SQL> select name from sde.versions order by name;
The following is an example of the results that would be returned from this query:
- Compare the replica system versions returned in Step 2 with the replica IDs from Step 1 to see if there are any versions listed that do not have a corresponding gdb_replicas table entry.
In the example listed in Step 2, SYNC_SEND_48_2 does not have a corresponding entry in the gdb_replicas table, so this replica system version is orphaned.
- Use the 'Delete Version (Data Management)' tool or the sdeversion -o delete command to remove the orphaned versions that have been identified at Step 3.
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 there are other orphaned versions besides the orphaned versions identified in Step 3.
- HowTo: Determine if there are orphaned replica system versions in the geodatabase - Versions 9.3.1 and earlier