HOW TO

Determine if there are orphaned replica system versions in the geodatabase

Last Published: March 13, 2023

Summary

Cases may arise where internal replica versions become orphaned in the geodatabase, resulting in a suboptimal geodatabase compress.

Instructions provided describe how to identify and delete these system replica versions that are no longer being used by a replica in the geodatabase.

Procedure

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.

Note:
These versions are hidden by design, which means they are not displayed using ArcGIS tools and not returned by ArcObjects. They should not be manually deleted using database tools. 

Replica system versions can be identified by the way they are named. Naming conventions for one-way and two-way replica system versions are as follows:

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 detached versions may cause a less than effective compress of the geodatabase.

The following steps describe how to identify and remove replica system versions that are no longer referenced by a replica in the geodatabase.

  1. 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.
Note:
For SQL Server, if using a dbo schema database, alter the syntax below to reflect dbo.GDB_ITEMS and dbo.GDB_ITEMTYPES.
  • SQL Server:
SELECT
ITEMS.ObjectID ,
ITEMS.Definition .value( '(/GPReplica/Name)[1]', 'nvarchar(max)') AS "Replica Name" ,
ITEMS.Definition .value( '(/GPReplica/ReplicaVersion)[1]', 'nvarchar(max)') AS "Replica Version" ,
ITEMS.Definition .value( '(/GPReplica/CreationDate)[1]', 'nvarchar(max)') AS "Creation Date"
from 
sde.GDB_ITEMS AS ITEMS INNER JOIN sde.GDB_ITEMTYPES AS ITEMTYPES
ON ITEMS .Type = ITEMTYPES .UUID
WHERE
 ITEMTYPES. Name = 'Replica';
  • Oracle:
Warning:
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';
The results of the query will return the ID and Replica Name. The ID is used as part of the system replica version naming convention.
  1. 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:

NAME
----------------------------------
DEFAULT
SYNC_RECEIVE_56_0
SYNC_RECEIVE_56_1
SYNC_RECEIVE_56_2
SYNC_RECEIVE_REC_56_2
SYNC_SEND_56_0
SYNC_SEND_57_0
SYNC_SEND_48_2
  1. 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 replica in the geodatabase (gdb_items table entry). In the example listed in Step 2, SYNC_SEND_48_2 does not have a corresponding entry in the gdb_items table, so this replica system version is orphaned.
  2. Use the Delete Version Data Management tool to remove the versions that have been identified in Step 3. The version can be manually typed in the tool.
Warning:
Ensure a current database backup is available before proceeding. 
No other replica system versions should be deleted from the geodatabase, as this can lead to corruption of the existing replicas.
Note:
Please contact Esri Support Services if there are other detached versions besides the detached versions identified in Step 3.

Article ID:000011719

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic