In our environment, we want all coded domains to be owned by a specific user. If a coded domain gets created by another user (for example, dragging in a feature class from another geodatabase), there is no way to change the owner, short of removing the domain from any field that references it, exporting the domain to a table, deleting it, re-creating it from the table, and then reassigning it to any feature class that makes use it it. In ArcSDE 9.3.1 (at least, in Oracle), it was a trivial matter to open the geodastabase and, using SQL Plus, simply change the owner of the domain.
A tool for changing domain owners is still needed as much now, if not more then when this idea was created!
I found a way to do this in Microsoft SQL Server using an SET statement with a modify function. In the example below, I change the domain owner of the 'DATA QUALITY CODE_3' to the user 'SDE', but it could be set to any user account regardless of the owner. I was able to figure this out using ESRI's tech article "How To: Return information on coded value domains using ArcSDE 10.x for SQL Server."
UPDATE [GeoLib].[sde].[GDB_ITEMS]
SET [Definition].modify('
replace value of
(/GPCodedValueDomain2/Owner/text())[1]
with ("SDE")')
WHERE TYPE in ('8C368B12-A12E-4C7E-9638-C9C64E69E98F','C29DA988-8C3E-45F7-8B5C-18E51EE7BEB4')
AND PhysicalName = 'DATA QUALITY CODE_3'
go
In Line 6, is the GUID in your script a constant to all geodatabases? and does this actually reset the owner or just the name or some kind of alias? background is...I imported a dataset from another database with the GDB owner of DBO via XML and the target geodatabase does not have dbo as a user, the data owner is SDEADMIN, GDB owner is SDE.
A new domain owner can be specified in the Alter Domain tool starting in ArcGIS Pro 3.0. See Ideas in ArcGIS Pro 3.0 to catch up on all of the ideas you can look forward to when you upgrade.
Also check out the full What's New documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.