Problem: Unable to assign a domain to a field in a feature class
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.
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:
- Create the dataset with the user as the owner.
- Grant privileges such as CREATE FUNCTION, CREATE PROCEDURE, CREATE TABLE, and CREATE VIEW PERMISSION to the user in SQL Server.
- In ArcCatalog, establish a connection to the geodatabase with the user.
- 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.
- Delete the original feature class owned by the dbo, and rename the new feature class by removing the ‘_1’ in the name.
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.
- ArcGIS Help: Rules for working with schema locks
- ArcGIS Help: Assign Domain To Field
- ArcGIS Help: File geodatabases and locking
- ArcGIS Help: Manage geodatabase locks
- ArcGIS Pro: 000464: Cannot get exclusive schema lock. Either being edited or in use by another application.
- FAQ: Do I need to re-grant privileges on a feature dataset after adding a new feature class?