Delete features in SDE with python

340
2
03-23-2011 04:52 AM
KevinBurton
New Contributor
We are running ArcGIS Server 9.3.1 with Oracle 11g.  I have a number of featureclasses in the SDE database that needs to be replaced once a week.  Each week I get CSV files from our mainframe that need to be loaded to the Featureclasses in SDE replacing the features that are already there.  I have written a python script to handle all the processing involved, but it takes 19 hours to run.  It appears that the srcipt is having trouble with the DeleteFeatures_Management tool and takes a very long time to run.  It hangs on the largest Featuredataset which contains 210230 features.  The rest of the script takes only 20 minutes to run.  This data is being used in a web map to allow the field crews access to the data.  Because of this, I have versioned the data so I would not have to disable the service for the web map. 

Is there a more efficient way to delete all the features in the featureclasses?
Tags (2)
0 Kudos
2 Replies
EricFowler
New Contributor
Kevin,

The only thing I can think of is to make sure your versions are reconciled, posted, deleted and db compressed.

Are you able to use 10?

Could you provide the python script you are doing to update SDE weekly?  I have been trying to do this and keep running into issues with versions and/or locking (I have an ArcGIS Server service hitting the feature class).

Thanks,

Eric Fowler

We are running ArcGIS Server 9.3.1 with Oracle 11g.  I have a number of featureclasses in the SDE database that needs to be replaced once a week.  Each week I get CSV files from our mainframe that need to be loaded to the Featureclasses in SDE replacing the features that are already there.  I have written a python script to handle all the processing involved, but it takes 19 hours to run.  It appears that the srcipt is having trouble with the DeleteFeatures_Management tool and takes a very long time to run.  It hangs on the largest Featuredataset which contains 210230 features.  The rest of the script takes only 20 minutes to run.  This data is being used in a web map to allow the field crews access to the data.  Because of this, I have versioned the data so I would not have to disable the service for the web map. 

Is there a more efficient way to delete all the features in the featureclasses?
0 Kudos
KevinBurton
New Contributor
Eric,

I am currently unable to use 10.  I attached the script for you to view.  The data is registered as versioned with the option to move edits to base, and this is the only editing that occurs with this data.  I run a compress at the end of the script which pushes all the edits to the base tables. 

After some serious searching, it appears that we may need to run a delete command directly on the server from the command prompt.  Oracle doesn't seem to like it when you delete a large number of records at once.  We are still looking into this.

Kevin

Kevin,

The only thing I can think of is to make sure your versions are reconciled, posted, deleted and db compressed.

Are you able to use 10?

Could you provide the python script you are doing to update SDE weekly?  I have been trying to do this and keep running into issues with versions and/or locking (I have an ArcGIS Server service hitting the feature class).

Thanks,

Eric Fowler
0 Kudos