Sub topic 7
Ownership and delegated management
This chapter assumes you know the Unity Catalog object hierarchy (metastore, catalog, schema, table), how GRANT and REVOKE work, and how privileges are inherited down the hierarchy. Here you will learn who owns an object, what ownership allows, and how to delegate management safely.
What ownership means
Every securable object has exactly one owner. By default, the owner is the principal that created the object. The owner can do the following:
- Grant and revoke privileges on the object to other principals.
- Rename, alter, or drop the object.
- Transfer ownership to another principal.
Ownership also extends down the hierarchy. The owner of a catalog can manage that catalog, but ownership of a catalog does not make you the owner of the schemas inside it. Each object keeps its own owner.
An owner does not automatically hold every privilege. For example, a table owner can grant SELECT on the table to others, and the owner should be able to read it in practice, but you should not treat ownership as a substitute for explicit grants in your design.
Transfer ownership to a group
If a person owns an object and then leaves the team, nobody else may be able to manage it. The usual fix is to transfer ownership to a group.
ALTER TABLE main.sales.orders OWNER TO `data-engineers`;After this statement, any member of data-engineers can manage the table. Membership changes in the group take effect without touching the table. You can run a similar ALTER ... OWNER TO statement for other object types, such as ALTER SCHEMA and ALTER CATALOG.
The MANAGE privilege
Sometimes you want someone to administer an object without making them the owner. The MANAGE privilege allows this. A principal with MANAGE on an object can grant and revoke privileges on it, and can transfer its ownership.
GRANT MANAGE ON SCHEMA main.sales TO `sales-leads`;This lets sales-leads delegate access within the schema while the owner stays a different group. Because MANAGE is a privilege, it follows the same inheritance rules as other privileges. Granting it on a schema gives the same ability on the objects inside.
| Capability | Owner | Holder of MANAGE |
|---|---|---|
| Grant and revoke privileges | Yes | Yes |
| Transfer ownership | Yes | Yes |
| Exists once per object | Yes | No, many principals can hold it |
Common errors
- Owning objects as an individual. Objects stay tied to a person who may change roles or leave. Transfer ownership of shared objects to a group.
- Granting
MANAGEtoo widely. A holder can grant access to others, so treat it as a powerful privilege and give it only to trusted groups. - Expecting catalog ownership to cover child objects. Owning a catalog does not make you the owner of the schemas and tables inside it. Check each object with
DESCRIBEor the catalog explorer when you need to know its owner. - Changing ownership without checking dependents. Jobs and views that depend on the object may run as the old owner. Review them before you transfer ownership.
Exercise
A table was created by a user who has left the company. Nobody on the team can grant access to it. What should an administrator do, and what should the new setup look like?
Show answer
An administrator, or a principal with MANAGE on the table, should transfer ownership with ALTER TABLE ... OWNER TO to a group such as data-engineers. Owning shared objects through a group means management no longer depends on one person.