Identify where domains have been applied in a geodatabase

Last Published: April 25, 2020


In order to delete or modify a domain, it must not be associated with any fields in the geodatabase. SQL queries are provided below to list each domain association. These queries are applicable to ArcSDE for Oracle and ArcSDE for SQL Server 9.0 and 9.1.However, be aware that if there are any changes to the geodatabase metadata schema relating to domains in future releases of ArcSDE, then these queries may not give the correct results. Therefore, this information is for internal use only.


Connect to the database as any valid database user to run these commands.

For ArcSDE for Oracle, the following optional commands will make the output more readable in SQLPlus:

column Object_Owner format a15
column Domain_Owner format a15
column Domain_Name format a15
column Object_Name format a15
column Field_Name format a15
column Subtype_Name format a15

The following queries can be run in either SQLPlus for Oracle or Query Analyzer for SQL Server:

Query to list domains applied at the feature class level:

SELECT DO.owner Domain_Owner, FI.defaultdomainname Domain_Name,OC.owner Object_Owner, Object_Name,FI.fieldname Field_Name
FROM sde.gdb_objectclasses OC,sde.gdb_fieldinfo FI, sde.gdb_domains DO
WHERE AND DO.domainname=FI.defaultdomainname
AND FI.defaultdomainname IS NOT NULL
ORDER BY Domain_Owner, Domain_Name,Object_Owner,Object_Name

Query to list domains associated at the subtype level:

SELECT DM.owner Domain_Owner,DM.domainname Domain_Name, Object_Name,ST.subtypename Subtype_Name,AR.fieldname Field_Name
FROM sde.gdb_domains DM,sde.gdb_objectclasses OC,sde.gdb_subtypes ST,sde.gdb_attrrules AR,sde.gdb_validrules VR
WHERE (AR.domainname=DM.domainname) AND ( AND (VR.classid = AND(AR.subtype=ST.subtypecode)
ORDER BY Domain_Owner,Domain_Name,Object_Name,Subtype_Name

If these SQL queries are in SQLPlus, be sure to add a ";" to the end of each statement.

Article ID:000007998

  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic