Find Layers With Versioning

1247
11
Jump to solution
11-27-2013 12:00 AM
User35489
Occasional Contributor III
Good Day Gents,

I am looking for a query or a method which can list me all the 'layers with versioning' in a geodatabse.
Please let me know.


Thanks
-AS
0 Kudos
1 Solution

Accepted Solutions
WilliamCraft
MVP Regular Contributor
In Oracle, this should give you the list of VERSIONED object classes for a 9.3.1 geodatabase along with their respective A, D, F, and S tables:

SELECT r.OWNER, r.TABLE_NAME, r.ADDS_TABLE, r.DELETES_TABLE,
CASE
    WHEN l.LAYER_ID IS NOT NULL THEN ('F'||l.LAYER_ID)
    ELSE ' '
END feature_table,
CASE
    WHEN l.LAYER_ID IS NOT NULL THEN ('S'||l.LAYER_ID)
    ELSE ' '
END spatial_table
FROM (
SELECT OWNER, TABLE_NAME, OBJECT_FLAGS,
substr('A'||registration_id,1,10) adds_table,
substr('D'||registration_id,1,10) deletes_table
FROM SDE.TABLE_REGISTRY
WHERE OBJECT_FLAGS IN ('11', '15', '16399', '114693') AND OWNER IN ('[schema you care about]')
ORDER BY OWNER, TABLE_NAME) r
LEFT JOIN SDE.LAYERS l ON l.OWNER = r.owner AND l.TABLE_NAME = r.TABLE_NAME;

View solution in original post

0 Kudos
11 Replies
EmadAl-Mousa
Occasional Contributor III
you didn't specify which geodatabse version you are using....

check this tool: http://www.arcgis.com/home/item.html?id=218fb05252cd4746be21b9565f648b5b

Also, you can use "python" scripting to list "versioned feature classes".
0 Kudos
KimPeter
Esri Contributor
0 Kudos
User35489
Occasional Contributor III
Thanks all for your excellent information.

I tried the tool, it worked fine for ArcGIS Desktop 10 and ArcSDE 10.1, but when i tried to run it on ArcGIS Desktop 10 and ArcSDE 9.3. It failed with below error.
Please advise

"An error appearsThe index passed was not within the valid range"

Regards
-AS
0 Kudos
EmadAl-Mousa
Occasional Contributor III
try rebuilding/analyze the indexes for the layers the error complained about.
0 Kudos
User35489
Occasional Contributor III
try rebuilding/analyze the indexes for the layers the error complained about.


Actually the tool works on 'SDE connection' file, not on particular layer/dataset.
I tried both direct and advanced server connections.

If you have 9.3 ArcSDE and 10.0 Desktop, you may try it and check whether it is working fine with you.

-AS
0 Kudos
NidhinKarthikeyan
Occasional Contributor III


I tried the tool, it worked fine for ArcGIS Desktop 10 and ArcSDE 10.1, but when i tried to run it on ArcGIS Desktop 10 and ArcSDE 9.3. It failed with below error.
Please advise

"An error appearsThe index passed was not within the valid range"




It might be because the storage in 9.3 Geodatabase is Low Precision.
0 Kudos
User35489
Occasional Contributor III
It might be because the storage in 9.3 Geodatabase is Low Precision.


Yes you are correct. The storage is low precision.
What could be the workaround for this situation.

-AS
0 Kudos
NidhinKarthikeyan
Occasional Contributor III
You can try the following in a test environment:

Take a complete backup of the database and upgrade it to 10 or >. I don't think it is feasible for you to do it.

Vince will be here. You can wait for his suggestion.
0 Kudos
WilliamCraft
MVP Regular Contributor
In Oracle, this should give you the list of VERSIONED object classes for a 9.3.1 geodatabase along with their respective A, D, F, and S tables:

SELECT r.OWNER, r.TABLE_NAME, r.ADDS_TABLE, r.DELETES_TABLE,
CASE
    WHEN l.LAYER_ID IS NOT NULL THEN ('F'||l.LAYER_ID)
    ELSE ' '
END feature_table,
CASE
    WHEN l.LAYER_ID IS NOT NULL THEN ('S'||l.LAYER_ID)
    ELSE ' '
END spatial_table
FROM (
SELECT OWNER, TABLE_NAME, OBJECT_FLAGS,
substr('A'||registration_id,1,10) adds_table,
substr('D'||registration_id,1,10) deletes_table
FROM SDE.TABLE_REGISTRY
WHERE OBJECT_FLAGS IN ('11', '15', '16399', '114693') AND OWNER IN ('[schema you care about]')
ORDER BY OWNER, TABLE_NAME) r
LEFT JOIN SDE.LAYERS l ON l.OWNER = r.owner AND l.TABLE_NAME = r.TABLE_NAME;
0 Kudos