HOW TO

Identify where domains have been applied in a geodatabase

Last Published: April 25, 2020

Summary

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.

Procedure

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:

Code:
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:

Code:
SELECT DO.owner Domain_Owner, FI.defaultdomainname Domain_Name,OC.owner Object_Owner,OC.name Object_Name,FI.fieldname Field_Name
FROM sde.gdb_objectclasses OC,sde.gdb_fieldinfo FI, sde.gdb_domains DO
WHERE OC.id=FI.classid 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:

Code:
SELECT DM.owner Domain_Owner,DM.domainname Domain_Name,OC.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 (AR.ruleid=VR.id) AND (VR.classid = OC.id) AND(AR.subtype=ST.subtypecode)
ORDER BY Domain_Owner,Domain_Name,Object_Name,Subtype_Name


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

Article ID:000007998

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic