ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Geodatabase Schema Compare

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Compares a base and test schema and reports the differences between the two that are relevant to data loading, such as feature classes, tables, spatial references, and field definitions.

Usage

  • This tool only reports differences in the schema of the databases and does not compare the contents.

  • The base file is considered the authoritative file for the schema, while the test file contains a schema that will be compared to the base to determine whether it has the expected schema.

  • Comparison is done against XML workspace documents. When geodatabases are selected for the base_geodatabase_schema or test_geodatabase_schema parameters, the schema is exported to an XML workspace document before the comparison occurs.

  • The following table explains which schema elements are compared and provides a general description of the results.

    Schema elementResults description

    Domains

    Domains and domain values that are in the base or test schema and not present in the test or base schema or have attributes that differ, such as the coded values and their descriptions.

    Feature classes

    Feature classes that are not present in the test or base schema or have attributes that differ, such as the name or spatial reference.

    Feature datasets

    Feature datasets that are present in the base or test schema but not in the test or base schema or have attributes that differ, such as the name, dataset type, and spatial reference.

    Fields

    Fields that are present in the base or test schema but not in the test or base schema or have attributes that differ, such as the name, type, length, precision, and scale.

    Tables

    Tables that are present in the base or test schema but not in the test or base schema or have attributes that differ, such as the name, alias, and field names.

    Topologies

    Topologies that are present in the base or test schema but not in the test or base schema or have attributes that differ, such as the feature classes and rank

  • This tool does not support comparison of relationship classes, annotation, networks, parcel fabric, geometric networks, and representations.

  • This tool does not compare system generated fields like OBJECTID, SHAPE.AREA, and SHAPE.LEN.

  • This tool does not support evaluation of workspaces which contain duplicate table names.

Syntax

arcpy.Reviewer.GeodatabaseSchemaCompare(base_geodatabase_schema, test_geodatabase_schema, output_folder_path, {ignore_options})
ParameterExplanationData Type
base_geodatabase_schema

XML document or geodatabase that contains the authoritative version of the geodatabase schema.

Workspace; File
test_geodatabase_schema

XML document or geodatabase that contains the schema to compare to the base version.

Workspace; File
output_folder_path

Folder where the comparison report will be generated. This folder will contain other folders and files that support the derived html_output parameter.

Folder
ignore_options
[ignore_options; ignore_options,...]
(Optional)

Indicates the properties that will not be compared.

  • IGNORE_DOMAINS —Do not compare domain properties.
  • IGNORE_DATABASETOPOLOGY —Do not compare topology properties.
  • IGNORE_HASMS —Do not compare measure properties.
  • IGNORE_HASZS —Do not compare elevation properties.
String

Derived Output

NameExplanationData Type
schema_match

The result of the schema comparison.

Boolean
xml_output

Output XML file from the schema comparison.

File
html_output

Output HTML report from the schema comparison.

File

Code sample

GeodatabaseSchemaCompare example (stand-alone script)

The following Python example demonstrates how to use the GeodatabaseSchemaCompare tool.

# Name: SchemaCompareExample.py
# Description: Compares two schemas and reports their differences
# Author: Esri
# Date: September 2013

import arcpy
arcpy.CheckOutExtension("datareviewer")

# Define variables
base = "c:/data/edit_sample.xml"
test = "c:/data/edit_modifications.xml"
folder = "c:/data/sc_results"
ignoreOptions="IGNORE_DATABASETOPOLOGY;IGNORE_HASMS"

# Compare the workspaces
arcpy.GeodatabaseSchemaCompare_Reviewer(base,test,folder,ignoreOptions)

Environments

  • Current Workspace

Licensing information

  • Basic: Requires Data Reviewer
  • Standard: Requires Data Reviewer
  • Advanced: Requires Data Reviewer

Related topics

  • An overview of the Data Reviewer toolbox

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal