Repair Version Tables (Data Management)

Summary

Repairs inconsistencies in the delta (A and D) tables of a versioned geodatabase.

Usage

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

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

  • This tool is not supported for geodatabases in SAP HANA.

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

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

Syntax

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

Provide a 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

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

File
target_version
(Optional)

Specify which geodatabase version to repair. If no version is specified, all versions are processed.

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

Specify a single table or provide a text file containing a list of versioned tables whose associated delta tables you want to repair. 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 database connection file productiongdb.sde.

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