Manage Unity Catalog object ownership

Each securable object in Unity Catalog has an owner. The owner can be any account-level user or group, called a principal. The principal that creates an object becomes its initial owner. An object’s owner has all privileges on the object, such as SELECT and MODIFY on a table, in addition to the permission to grant privileges to other principals.

Object ownership can be transferred to other principals by either the current owner, a metastore admin, or the owner of the catalog or schema that contains the table.

Show owner

To see the owner of a securable object, use the following syntax. Replace the placeholder values:

  • <SECURABLE_TYPE>: The type of securable, such as CATALOG or TABLE.

  • <catalog>: The parent catalog for a table or view.

  • <schema>: The parent schema for a table or view.

  • <securable_name>: The name of the securable, such as a table or view.

DESCRIBE <SECURABLE_TYPE> EXTENDED <catalog>.<schema>.<securable_name>;
display(spark.sql("DESCRIBE <SECURABLE_TYPE> EXTENDED <catalog>.<schema>.<securable_name>"))
library(SparkR)

display(sql("DESCRIBE <SECURABLE_TYPE> EXTENDED <catalog>.<schema>.<securable_name>"))
display(spark.sql("DESCRIBE <SECURABLE_TYPE> EXTENDED <catalog>.<schema>.<securable_name>"))

Transfer ownership

To transfer ownership of an object, use a SQL command with the following syntax. Replace the placeholder values:

  • <SECURABLE_TYPE>: The type of securable object, such as CATALOG or TABLE. METASTORE is not supported as a securable object in this command.

  • <SECURABLE_NAME>: The name of the securable.

  • <PRINCIPAL>: The email address of an account-level user or the name of an account-level group.

ALTER <SECURABLE_TYPE> <SECURABLE_NAME> OWNER TO <PRINCIPAL>;
spark.sql("ALTER <SECURABLE_TYPE> <SECURABLE_NAME> OWNER TO <PRINCIPAL>")
library(SparkR)

sql("ALTER <SECURABLE_TYPE> <SECURABLE_NAME> OWNER TO <PRINCIPAL>")
spark.sql("ALTER <SECURABLE_TYPE> <SECURABLE_NAME> OWNER TO <PRINCIPAL>")

For example, to transfer ownership of a table to the accounting group:

ALTER TABLE orders OWNER TO `accounting`;
spark.sql("ALTER TABLE orders OWNER TO `accounting`")
library(SparkR)

sql("ALTER TABLE orders OWNER TO `accounting`")
spark.sql("ALTER TABLE orders OWNER TO `accounting`")