English

How To: Determine if there are orphaned replica system versions in the geodatabase

Summary

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.

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 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.

  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.Definition .value( '(/GPReplica/ID)[1]', 'nvarchar(max)') AS "ID" ,
    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';

  2. 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

  3. 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.
  4. 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.

    Warning:
    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 orphaned versions besides the orphaned versions identified in Step 3.

Related Information