How to find every reference to a particular domain in a geodatabase?

Discussion created by RudinA on Mar 12, 2014
Latest reply on Nov 28, 2014 by xander_bakker
Does anyone know how to use python to find every field (and fields on subtypes) that use a particular domain? Our SDE is 10.2 and on an Oracle database, and I have desktop 10.2.1. Basically if I need to change a domain (like change it's data type from string to integer) I need to delete it and recreate it.  In order to delete it I need to find every place it's used and un-reference it. This is hard to do in a large SDE where domains are shared between many fields and feature classes.

The out of the box method seems to be looping through EVERY feature class(and subtype) on the database and running arcpy.describe on every field see if they use a particular domain.  This seems extremely inefficient and will take forever on our large SDE.  Surely there must be a better way.

I figured querying the SDE administration tables would be quicker but ran into some walls.  By querying the GDB_Items and GDB_ItemRelationship tables I was able to see what feature classes reference a domain, but these don't seem to tell you which field(s) are using the domain, nor does it seems to show if a particular subtype uses a domain.

I was curious how SDE at 10.2 actually stores that a field is using domain x, and also how it tracks that subtype y uses domain x.  This way I can query the administration tables directly to make this process much faster.

I plan to use the proper toolbox tools to make the domain assignment changes, I just want to query the administrative tables to find the references and quickly as possible.

Thank you for any help you can provide,