Summary
Enables archiving on a table, feature layer, or feature dataset.
Usage
Enabling archiving provides the functionality to record and access changes made to a dataset over time.
Archiving is only supported on enterprise geodatabases. File and personal geodatabases do not support archiving.
Archiving may be enabled on versioned or nonversioned data.
Syntax
EnableArchiving_management (in_dataset)
Parameter | Explanation | Data Type |
in_dataset | The name of the dataset on which to enable archiving. | Feature Layer; Table View; Feature Dataset |
Code sample
EnableArchiving example (Python window)
The following code snippet illustrates how to use the EnableArchiving tool in the Python command window.
arcpy.EnableArchiving_management("Database Connections//toolbox.county.parcels")
EnableArchiving example (stand-alone Python script)
The following script illustrates how to use the EnableArchiving tool in a stand-alone script.
# Name: EnableArchiving_Example.py
# Description: Enable archiving on a dataset
# Import system modules
import arcpy
# Set local variables
in_dataset = 'C:/Data/connections/Redlands.sde/TEST.TOOLBOX.rdlsstreets'
# Describe the properties of the dataset to see if archiving is enabled.
desc = arcpy.Describe(in_dataset)
isArch = desc.IsArchived
# Enable Archiving if it is not already enabled.
if isArch == False:
# Execute EnableArchiving
arcpy.EnableArchiving_management(in_dataset)
print("{0} has been enabled for archiving.".format(in_dataset))
elif isArch == True:
# If IsArch = True, then archiving is already enabled
print("{0} already has archiving enabled.".format(in_dataset))
Environments
Licensing information
- ArcGIS Desktop Basic: No
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes