Proper use of Rebuild Indexes and Analyze Datasets tools

17424
20
07-22-2015 09:14 AM
BlakeTerhune
MVP Regular Contributor

I'm trying to build some SDE maintenance Python scripts and found this help document very informative.

ArcGIS Help 10.2 - Using Python scripting to batch reconcile and post versions

However, I noticed that the detailed section on Rebuild Indexes and Analyze Datasets does not uses the NO_SYSTEM option for include_system, but the full example code at the bottom does. Could someone clarify exactly what the include_system option does and which is the recommended way to use it? Maybe a Python​ expert can help?

20 Replies
WesMiller
Regular Contributor III

Is your sde user an admin.? I pretty sure the user must have admin. to run these tools.

0 Kudos
MonicaRuiz
New Contributor

Ok. So, no matter which user but the user must have admin privileges?

Because I am trying to find why I have differences between the feature class table and oracle table.... between what ArcCatalog shows and what TOAD shows....

0 Kudos
BlakeTerhune
MVP Regular Contributor

You really do have to be the owner of the table to run these tools. The SDE user can only run it on SDE tables.

As for why you are seeing differences, I'm assuming it's because you're looking at a versioned feature class that has had edits made but the database hasn't been compressed. What Toad sees is only the base table but ArcGIS sees the combination of the base table and the delta tables (A and D tables with adds and deletes). Check the SDE.TABLE_REGISTRY to get the owner and registration_id of the feature class:

select * from sde.table_registry where table_name = 'YOUR_FC_NAME';

Then use those values to look at the delta tables:

select * from OWNER.Aregid;
select * from OWNER.Dregid;‍‍‍‍

My guess is that you'll see the changes somewhere in the A or D table of the feature class. You can check the row count of SDE.STATES table. There is only one row if your database has a full compress. There will be a single row for each version you have. Anything extra represents changes that have been made but not compressed into the base table. If you run compress, you can check the SDE.COMPRESS_LOG table to see the result of the compress operation.

MonicaRuiz
New Contributor

Great! You are right! I had made a compress with the geoprocessing tool but I am seeing three rows for the owner at the sde.states.... how can I do a full compress? Thanks in advance!

0 Kudos
BlakeTerhune
MVP Regular Contributor

The best way to get a full compress is to disconnect all users, reconcile and post all versions, then run the compress. If that's not feasible, just reconcile all versions and disconnect any user with a lock on the feature class you are trying to get compressed, then run compress.

MonicaRuiz
New Contributor

I finally could do a reconcile and the compress... but I am still having differences.... I guess the problem is that I can not compress the database with the owner of the FC.... just with the sde user....

0 Kudos
BlakeTerhune
MVP Regular Contributor

You should be running compress as SDE.

0 Kudos
MonicaRuiz
New Contributor

Yes, I did it. But the differences still exists.... what I realize is that there are two versions: sde.default and another one called yte.mobile. And the FC was created with the user "OW". Let me explain that I didn't install and configure this geodatabase.... just trying to solve problems

0 Kudos
BlakeTerhune
MVP Regular Contributor

You should start a new thread for your question. Be sure to include the information about what versions you have, what feature class you are looking at, and the owners of everything.

0 Kudos
MonicaRuiz
New Contributor

Thanks for all of your help.

I had created one https://community.esri.com/message/636762-troubles-with-feature-class-table . I added more information about the situation...

0 Kudos