Repair Version Tables (Data Management)

Summary

Repairs inconsistencies in the delta (A and D) tables of datasets that are registered for traditional versioning.

Usage

  • Run the Diagnose Version Tables tool to determine if there are inconsistencies in your geodatabase delta tables before you run the Repair Version Tables tool.

  • This tool can only be run on an enterprise geodatabase.

  • This tool does not support geodatabases in SAP HANA because they don't support traditional versioning.

  • Only the geodatabase administrator can run the Repair Version Tables tool.

  • Always create a database backup before running the Repair Version Tables tool.

Parameters

LabelExplanationData Type
Input Database Connection

The database connection (.sde file) to the enterprise geodatabase in which delta table inconsistencies exist. The connection must be made as the geodatabase administrator.

Workspace
Repair Version Tables Log

The location where the log file will be written and the name of the log file. The log file is an ASCII file containing the results of the repair operation.

File
Target Version
(Optional)

The geodatabase version to be repaired. The drop-down list is populated with the existing versions in the geodatabase specified for the Input Database Connection parameter. If no version is selected, all versions are processed.

String
Input Tables
(Optional)

A single table or a text file containing a list of versioned tables with the associated delta tables to be repaired. Use fully-qualified table names in the text file, and place one table name per line. If no table or file is specified, all tables are processed.

String

Derived Output

LabelExplanationData Type
Repaired Geodatabase

The repaired geodatabase.

Workspace

arcpy.management.RepairVersionTables(input_database, out_log, {target_version}, {input_tables})
NameExplanationData Type
input_database

The database connection (.sde file) to the enterprise geodatabase in which delta table inconsistencies exist. The connection must be made as the geodatabase administrator.

Workspace
out_log

The location where the log file will be written and the name of the log file. The log file is an ASCII file containing the results of the repair operation.

File
target_version
(Optional)

The geodatabase version to be repaired. If no version is specified, all versions are processed.

String
input_tables
[input_tables,...]
(Optional)

A single table or a text file containing a list of versioned tables with the associated delta tables to be repaired. Use fully-qualified table names in the text file, and place one table name per line. If no table or file is specified, all tables are processed.

String

Derived Output

NameExplanationData Type
out_workspace

The repaired geodatabase.

Workspace

Code sample

RepairVersionTables example 1 (Python window)

You can alter and run the following from a Python window to repair inconsistencies in delta tables for the Parcels feature class.

This example connects through the productiongdb.sde database connection file.

import arcpy

input_database = "c:\\temp\\productiongdb.sde"
out_log = "c:\\temp\\gdb_repair.log"
target_version = "SDE.Default"
input_tables = "GIS.Parcels"

arcpy.RepairVersionMetadata_management(input_database, out_log, target_version, 
                                       input_tables)
RepairVersionTables example 2 (stand-alone script)

The following is a stand-alone script you can alter and run to repair inconsistencies in the delta tables of the Parcels feature class.

# Description: repair version metadata

# Set the necessary product code
import arceditor
 
# Import arcpy module
import arcpy

# Local variables:
input_database = "c:\\temp\\productiongdb.sde"
out_log = "c:\\temp\\gdb_repair.log"
target_version = "SDE.Default"
input_tables = "GIS.Parcels"

# Process: Repair Version Metadata
arcpy.RepairVersionMetadata_management(input_database, out_log, target_version, 
                                       input_tables)

Environments

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics