find out the list of versioned feature classes or Dataset.

739
5
05-21-2012 01:15 AM
AntonyPaul_M1
New Contributor III
Hi All,

I have a ArcSDE Geodatabase and have n number of dataset and layers, Its really huge.

I want to find out the list of versioned feature classes or Dataset.

Is there any way to query the SDE syetem tables and find?

Your help is really appreciated

Many Thanks

Cheers
Antony
0 Kudos
5 Replies
VinceAngelo
Esri Esteemed Contributor
The problem with using SQL in pre-10.0 databases to query this information is that the
same query won't work in 10.x instances.  Both ArcObjects and Python can generate
lists of feature datasets and the feature classes within them in a release-independent
manner.  You'd have to poll each FC to deterimine if it was versioned.

There are forums dedicated to both ArcObjects and Python where you could pursue the
details for each, but be sure to specify your ArcGIS version and service pack, so they
can give you the most appropriate "best" solution.

- V
0 Kudos
AntonyPaul_M1
New Contributor III
The problem with using SQL in pre-10.0 databases to query this information is that the
same query won't work in 10.x instances.  Both ArcObjects and Python can generate
lists of feature datasets and the feature classes within them in a release-independent
manner.  You'd have to poll each FC to deterimine if it was versioned.

There are forums dedicated to both ArcObjects and Python where you could pursue the
details for each, but be sure to specify your ArcGIS version and service pack, so they
can give you the most appropriate "best" solution.

- V


Thanks for the Reply.

I am currently in  ArcGIS 9.3 and Oracle 10g

Cheers
Antony
0 Kudos
AntonyPaul_M1
New Contributor III
Hi

I got python script to find out all the verioned feature classes inside the Geodatabase. It works for me so I thought of sharing it with you guys,

import sys, string, os, arcgisscripting, logging

log_File = "c:\\Documents and Settings\\apaul\\desktop\\sde_dataset_versioning.log"

# Set up log file
logger = logging.getLogger('myapp')
hdlr = logging.FileHandler(log_File)
formatter = logging.Formatter('%(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)

gp = arcgisscripting.create(9.3)
gp.workspace = "C:\\Documents and Settings\\apaul\\\desktop\\sde_con.sde"

fds = gp.ListDatasets()

for fd in fds:
    gp.workspace = "C:\\Documents and Settings\\apaul\\\desktop\\sde_con.sde\\%s" % fd
    fcs = gp.ListFeatureClasses()
    
    try:
        fc1 = fcs[0]
        desc = gp.Describe(fc1).IsVersioned
        print fd,desc
        logger.info('%s %s'%(fd,desc))
        
    except:
        pass
VinceAngelo
Esri Esteemed Contributor
The indent scheme is hyper-important in Python.  Please edit your solution so
it will work.  It would also be a good idea to post in a CODE block, so the text
is more legible (fixed-width font) -- use the "#" in the editor widgits.

- V
0 Kudos
FrédéricPRALLY
Esri Contributor
Hi antony,
Maybe you can used this add-in List versioned data,

Hope this help you,

Fred
0 Kudos