AnsweredAssumed Answered

Arcpy - Rebuild indexes in file geodatabase

Question asked by DemersM on Dec 4, 2019
Latest reply on Dec 13, 2019 by DemersM

I am trying to automatize the rebuild of file geodatabase indexes using arcpy v10.6, but I encounter an ERROR 000837 The workspace is not the correct workspace type.

 

Why? Does arcpy.RebuildIndexes_management() works only with Enterprise geodatabases? Then, how to rebuild indexes in file geodatabases?

 

Thank you

 

import arcpy, os

workspace = "C:/tmp/myDatabase.gdb"
fc = "MyFeatureClass"
arcpy.Exists(workspace)
>>>True
arcpy.Exists(os.path.join(workspace, fc))
>>>True

arcpy.RebuildIndexes_management(workspace, "NO_SYSTEM", [fc], "ALL")
>>>ERROR 000837 The workspace is not the correct workspace type.

Outcomes