Python Script - Updating Feature Class in SDE daily

5756
15
10-01-2015 05:17 PM
timdunlevie
Occasional Contributor

Hi all,

I am going to implement a nightly script which will remove all records in a Feature Class in our spatial DB, and append new records.

Apart from compressing the Database, is there anything else I should manage? Analyze ? Should I remove any locks that could be connected?

This process will run every night.

Will compressing the entire DB have an effect with any child/parent DBs ?

Also, are you able to compress a single Feature Class rather than an entire DB ?

we run 10.2

Thanks,

Tim

15 Replies
RandyKreuziger
Occasional Contributor III

Our Corporate Library SDE database has no versioned feature classes so we do the Truncate / Append all the time.  Many of the datasets are coming from other state agencies so it's just easier to do it this way.

0 Kudos
MichaelVolz
Esteemed Contributor

How often do you truncate and append your non-versioned feature classes from other state agencies?

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Instead of getting into the specifics of what works for us, and might not work for others, I encourage you to look over An overview of the Data Comparison toolset if you haven't already.  I have used both Feature Compare and Table Compare.  Although they require a bit of setup, once done, the tools can be quite efficient.  The Detect_Feature_Changes tool has always intrigued me, but I have never taken the time to try it out.

MichaelVolz
Esteemed Contributor

I agree with Joshua as the DBA of my organization would only do an incremental update of data in an SDE feature class and not a full truncate and append as there is a cost in swap space (or something to that effect) with the truncate and append process.

0 Kudos
BarryGuidry
Occasional Contributor

Tim, would you mind posting your script?  I did this in the past, and posted to the ESRI forums, but was removed with the archives I guess.

Thank you,

Barry Guidry

0 Kudos
timdunlevie
Occasional Contributor

Hi Barry,

I will have to dig out the code as I have since left the company I implemented this with…

Thanks,

Tim

0 Kudos