English

Problem: Unable to assign a domain to a field in a feature class

Description

After creating coded value domains for a geodatabase, ArcMap is unable to assign the domains to the fields in a feature class. In some cases, when assigning a domain to a field using the Assign Domain To Field tool, the tool fails to execute and the following error is returned:

Error:   
Cannot get exclusive schema lock.

Cause

A schema lock is present on the dataset. This means the database is being accessed by another application, which prevents users other than the data owner to make changes to the dataset (such as assigning domains to fields.)

For more information on schema locks, refer to the following ArcGIS Web Help page, Schema locking.

Solution or Workaround

Disconnect from the database server

Disconnect from the database server and close any other applications using data from the same geodatabase (such as ArcCatalog) to prevent any orphaned locks or orphaned connections with the database.

For more information on disconnecting from a database, refer to the following ArcGIS Web Help page, Disconnect from a database server.

Change the ownership of the dataset

Change the ownership of the dataset to acquire the privileges of altering the schema of the dataset. To change the ownership of the dataset, use the following instructions:

  1. Create the dataset with the user as the owner.
  2. Grant privileges such as CREATE FUNCTION, CREATE PROCEDURE, CREATE TABLE, and CREATE VIEW PERMISSION to the user in SQL Server.
  3. In ArcCatalog, establish a connection to the geodatabase with the user.
  4. Copy and paste the original data (feature class or feature dataset) to the connection. A new feature class owned by the user is created with '_1' after the original name.
  5. Delete the original feature class owned by the dbo, and rename the new feature class by removing the ‘_1’ in the name.
For more information on granting privileges on data, refer to the following ArcGIS Web Help page, Grant and revoke dataset privileges.
Note:
When assigning a domain to a field, ensure the data type of the field matches with the domain field type. This is because only the domains that match with the data type of the field show up in the drop-down list. For more information about field data type, refer to the following ArcGIS Web Help page, ArcGIS field data types.

Related Information