Select to view content in your preferred language

Problems with Unregister As Versioned scripting syntax (for use with Compression)

1025
2
01-14-2011 05:48 AM
JeremyCaldwell
Emerging Contributor
Arc 9.3.1
SQL Server 2008

All,

Wondering if I can get some help on this. I've spent the last few days scouring the message boards, help files and documents trying to get a handle on compressing our SDE database back to State ID 0.

I've followed everything that ESRI and other users have provided:

1. Reconcile and Post all versions (in this case not necessary since working in .DEFAULT)
2. Ensure no users are connected to the database
3. Delete any and all versions (to include all replicas (to take that out of the equation))
4. Analyze Feature Datasets and Feature Classes
5. Compress
6. Analyze Feature Datasets and Feature Classes

So fine, ESRI isn't perfect and I'm still not showing State ID 0 (I can safely say that it's not because of a corrupted state tree, unless it's prone to corrupt after a single edit session), so I sit down with our SQL DBA and we discuss other solutions for this problem.

The obvious answer is to unregister the data as versioned, this removes the Delta tables and obviously we go back to State ID 0. To ESRI's credit they've included the ability to compress edits to base while doing this, super, problem solved. Now we just need to automate this process.

A little looking and presto, problem solved:

import arcgisscripting

gp = arcgisscripting.create(9.3)

gp.workspace = "Database Connections\My Database Connection String"
gp.toolbox = "management"
gp.unregisterasversioned("Feature Dataset Name", "KEEP_EDIT", "COMPRESS_DEFAULT")


... sadness... problem not solved...

The problem comes with the keep_edit portion. My understanding of this is that by telling it to "KEEP_EDIT" it's going to "save" the Delta tables, then look at the compress_default parameter and, if "COMPRESS_DEFAULT" is used, then compress the Deltas into the Base table.

This does not happen though.

I get: ExecuteError: Error 000316: The following datasets contain edits: 'Feature Class Name'
Failed to execute (UnregisterAsVersioned).

This happens even after I've compressed the database via the steps listed above, and it seems that it shouldn't matter either way because the syntax should do this for me.

I cannot find a single help/bug report/forum post addressing this.

Now, if we use the ArcCatalog supplied ArcObjects 'Unregister as Versioned' tool, it works great, no issues, even if I haven't compressed the database, since the tool does this for me.

So my question is what am I doing wrong or is there a known issue with the scripting syntax?

Any help on this would be greatly appreciated.
0 Kudos
2 Replies
ChrisCwiek
Deactivated User
I experienced the exact same problem with ArcGIS 9.3 sp1 on Oracle 10.2.0.3.  I am going to log a support request with ESRI.

Chris
DTE Energy
0 Kudos
JeremyCaldwell
Emerging Contributor
I experienced the exact same problem with ArcGIS 9.3 sp1 on Oracle 10.2.0.3.  I am going to log a support request with ESRI.

Chris
DTE Energy


If you're refering to the scripting.  It's just poorly written.  In order for it to compress and keep the edits you actually have to say NO_KEEP_EDIT then COMPRESS_DEFAULT.  This will compress the edits to the basetable.

If you say KEEP_EDIT and COMPRESS_DEFAULT then it kicks that error because you're telling it you want to keep the edits in the delta tables and then also compress which doesn't work.

So like I said, it's a poorly written description of how the syntax is supposed to work.
0 Kudos