Compress File Geodatabase Data (Data Management)

Summary

Compresses all the contents in a geodatabase, all the contents in a feature dataset, or an individual stand-alone feature class or table.

Usage

Syntax

CompressFileGeodatabaseData_management (in_data)
ParameterExplanationData Type
in_data

The geodatabase, feature dataset, feature class, or table to compress.

Workspace; Feature Dataset; Table View; Raster Layer

Code Sample

CompressFileGeodatabaseData Example (Python Window)

The following example demonstrates how to use the CompressFileGeodatabaseData function in the python window.

import arcpy
arcpy.env.workspace = "C:/data/"
arcpy.CompressFileGeodatabaseData_management("london.gdb")
CompressFileGeodatabaseData Example (Stand-alone Python script)

The following example demonstrates how to use the CompressFileGeodatabaseData function in a standalone python script.

# Name: CompressFileGeodatabaseData.py
# Description: Use the CompressFileGeodatabaseData tool to compress a geodatabase
# Author: ESRI

# import system modules
import arcpy, os
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
geodatabase = "london.gdb"

try:
  # Process: Compress the data
  arcpy.CompressFileGeodatabaseData_management(geodatabase)

except:
  # If an error occurred while running the tool print the messages
  print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

10/27/2014