Disable Archiving (Data Management)

Summary

Disables archiving on a geodatabase feature class, table, or feature dataset.

Usage

  • Archiving is only supported on enterprise geodatabases. File and personal geodatabases do not support archiving.

  • The input dataset must be from a database connection established as the data owner.

Parameters

LabelExplanationData Type
Input Dataset

The geodatabase feature class, table, or feature dataset for which archiving will be disabled.

Table; Feature Class; Feature Dataset
Preserve History Table
(Optional)

Specifies whether records that are not from the current moment will be preserved. If the table or feature class is versioned, the history table will become available. For nonversioned data, a table or feature class will be created with an appended _h that contains the history information.

  • Checked—Records that are not from the current moment will be preserved. This is the default.
  • Unchecked—Records that are not from the current moment will not be preserved; they will be deleted.

Boolean

Derived Output

LabelExplanationData Type
Updated Input Dataset

The updated input dataset.

Table; Feature Class; Feature Dataset

arcpy.management.DisableArchiving(in_dataset, {preserve_history})
NameExplanationData Type
in_dataset

The geodatabase feature class, table, or feature dataset for which archiving will be disabled.

Table; Feature Class; Feature Dataset
preserve_history
(Optional)

Specifies whether records that are not from the current moment will be preserved.

If the table or feature class is versioned, the history table or feature will become enabled.

For nonversioned data, a table or feature class will be created that contains the history information. The name of the new dataset will be the same as the input with an appended _h.

  • PRESERVERecords that are not from the current moment will be preserved. This is the default.
  • DELETERecords that are not from the current moment will not be preserved; they will be deleted.
Boolean

Derived Output

NameExplanationData Type
out_dataset

The updated input dataset.

Table; Feature Class; Feature Dataset

Code sample

DisableArchiving example 1 (Python window)

The following Python window script demonstrates how to use the DisableArchiving tool in immediate mode.

import arcpy
arcpy.DisableArchiving_management("Database Connections//sam.hills", "PRESERVE")
DisableArchiving example 2 (stand-alone script)

The following script demonstrates how to use the DisableArchiving tool in a stand-alone script.

# Name: DisableArchiving_Example.py
# Description: Disable archiving on a dataset

# Import system modules
import arcpy

# Set local variables
in_dataset = "C:/Data/connections/intense.sde/intense.carbine.bike_routes"

# Run program
desc = arcpy.Describe(in_dataset)
if desc.isArchived == True:
  arcpy.DisableArchiving_management(in_dataset)
  print('Successfully disabled archiving on: {0}'.format(in_dataset))
else:
  print('Archiving has already been disabled.')

Environments

Related topics