Unity Catalog
Trace ownership and storage across the metastore, catalogs, and schemas. Compare managed and external tables and volumes.
What Unity Catalog provides
- Define once, secure everywhere: permissions apply in every workspace attached to the metastore.
- Standard SQL access control (
GRANT/REVOKE), row filters, column masks, ABAC policies. - Auditing of access (system tables
system.access.audit). - Lineage at table and column level, captured automatically for queries run on Databricks (shown in Catalog Explorer and
system.access.table_lineage/column_lineage). - Discovery: search, comments, tags, AI-generated documentation.
- Data sharing with Delta Sharing; federation of external databases.
The object hierarchy
Metastore (one per region; top-level container)
├── Catalog e.g. dev, prod, main
│ └── Schema (database) e.g. sales
│ ├── Table (managed / external)
│ ├── View, Materialized view, Streaming table
│ ├── Volume (managed / external) for files
│ ├── Function (UDF)
│ └── Model (registered ML model)
├── Storage credential cloud identity (IAM role, managed identity, service account)
├── External location storage path + storage credential
├── Connection credentials for an external system (federation, Lakeflow Connect)
├── Share / Recipient / Provider Delta Sharing
Reference objects as catalog.schema.object. A common pattern is one catalog per environment (dev, test, prod) or per business domain.
New workspaces are Unity Catalog enabled by default. Check in the account console (Workspaces, Metastore column) or with SELECT CURRENT_METASTORE();.
Storage: credentials, external locations, managed storage
- A storage credential wraps a cloud identity that can access storage. It grants access to cloud storage; a service credential grants access to other cloud services (called from code). Instance profiles are the legacy compute-level alternative.
- An external location = a cloud path + a storage credential. It governs who can read or create tables and volumes under that path (
READ FILES,WRITE FILES,CREATE EXTERNAL TABLE,CREATE EXTERNAL VOLUME). - Managed storage location can be set at metastore, catalog or schema level; managed tables and volumes go to the most specific one.
CREATE EXTERNAL LOCATION finance_raw URL 's3://acme-finance/raw'
WITH (STORAGE CREDENTIAL finance_cred);
CREATE CATALOG finance MANAGED LOCATION 's3://acme-finance/managed';
Connecting your own S3 bucket (AWS)
- Easy path (recommended): Catalog, External data, External locations, Create external location, AWS Quick Start. Give the bucket name and a personal access token; an AWS CloudFormation stack creates the IAM role, the storage credential and the external location for you.
- Manual path: create an IAM role whose trust policy lets the Databricks Unity Catalog role assume it, with an external ID condition; attach an IAM policy granting S3 access on the bucket (plus a file events policy if you want managed file events); create a storage credential in Catalog, External data, Credentials using the role ARN; copy its external ID into the trust policy and make the role self-assuming; click Validate configuration; then create the external location.
Creating the external location in SQL, followed by a grant on it:
CREATE EXTERNAL LOCATION IF NOT EXISTS landing
URL 's3://acme-landing/'
WITH (STORAGE CREDENTIAL acme_cred)
COMMENT 'Raw landing zone';
GRANT READ FILES ON EXTERNAL LOCATION landing TO `data-eng`;
Square brackets in the docs syntax mean "optional": do not type them.
Rules for credentials and external locations
- A storage credential can be marked read-only; write permissions in the IAM policy are then ignored.
- Validating a credential requires being its owner, a metastore admin, or holding
CREATE EXTERNAL LOCATION. - External locations cannot overlap: two locations cannot cover the same or nested paths.
- Credentials and external locations can be bound to specific workspaces, like catalogs.
- Keep the bucket in the same region as the metastore to avoid egress cost and latency, and avoid dots in S3 bucket names.
- An external location page has a Browse tab and a test that checks read, write, list and delete access.
Mounting buckets to DBFS and hard-coding access keys are legacy. With Unity Catalog, cloud storage is reached through storage credentials and external locations (or volumes), and grants such as READ FILES control access.
Catalogs: types and creation in the UI
When you create a catalog in the UI, you first choose its type:
| Catalog type | Holds |
|---|---|
| Standard | Your own schemas, tables, views, volumes, with managed storage |
| Foreign | A mirror of an external database through a connection (Lakehouse Federation) |
| Shared | Data received from a provider through Delta Sharing |
For a standard catalog you pick a managed storage location (an external location) or, where enabled, default storage managed by Databricks, which is reachable only from the workspace that created it. The wizard then sets workspace access (binding), permissions and tags.
Managed vs external tables: operations New exam
-- create
CREATE TABLE prod.sales.orders (id BIGINT, amount DECIMAL(10,2)); -- managed
CREATE TABLE prod.sales.orders_ext (id BIGINT, amount DECIMAL(10,2))
LOCATION 's3://acme-finance/raw/orders'; -- external
-- inspect
DESCRIBE TABLE EXTENDED prod.sales.orders_ext; -- Type: EXTERNAL, Location: s3://...
-- modify
ALTER TABLE prod.sales.orders ADD COLUMNS (channel STRING);
ALTER TABLE prod.sales.orders RENAME TO prod.sales.orders_v2;
ALTER TABLE prod.sales.orders_v2 SET OWNER TO `data-eng`;
-- delete and recover
DROP TABLE prod.sales.orders_v2; -- managed files are queued for removal after the recovery window
UNDROP TABLE prod.sales.orders_v2; -- restore within the configured recovery window (7 days by default)
DROP TABLE prod.sales.orders_ext; -- external: metadata only, files stay
-- convert external to managed (newer runtimes)
ALTER TABLE prod.sales.orders_ext SET MANAGED;
-- roll back that conversion (within 14 days)
ALTER TABLE prod.sales.orders_ext UNSET MANAGED;
SET MANAGED moves the table's data into managed storage and keeps history. To undo it, use ALTER TABLE ... UNSET MANAGED, which points the table back to its original external location. It is available for 14 days after conversion. RESTORE TABLE ... VERSION AS OF restores data versions, not the table type.
Converting managed to external has no single command: create an external table from the data (for example CREATE TABLE ... LOCATION ... AS SELECT or DEEP CLONE to a location), then swap names.
Volumes
CREATE VOLUME prod.raw.landing; -- managed volume
CREATE EXTERNAL VOLUME prod.raw.vendor LOCATION 's3://acme-finance/raw/vendor';
-- path: /Volumes/prod/raw/landing/...
GRANT READ VOLUME, WRITE VOLUME ON VOLUME prod.raw.landing TO `data-eng`;
Identities
- Users (people), groups (sets of users and other groups), service principals (identities for automation such as CI/CD and production jobs).
- Manage them at the account level (often synced from an identity provider via SCIM) and assign them to workspaces.
- Best practice: grant privileges to groups, not individuals; run production jobs as service principals.
Service principal roles
- Service Principal Manager: manages the roles on a service principal (the creator and account admins have it).
- Service Principal User: lets a user or group run jobs as the service principal (needed to set a job's Run as to it). Workspace admins assign service principals to workspaces.
- Service principals can be added to groups, granted Unity Catalog privileges, and given admin roles.
Admin roles
- Account admin: manages the account, metastores, identities.
- Metastore admin (optional): manages privileges and ownership across the metastore.
- Workspace admin: manages the workspace, its users, compute and settings.
- Object owner: every securable has an owner (user, service principal or group) with all privileges on it and the right to grant them.
Granting privileges and assigning ownership are two separate statements:
CREATE CATALOG finance;
GRANT ALL PRIVILEGES ON CATALOG finance TO `finance-engineers`;
ALTER CATALOG finance OWNER TO `finance-admins`; -- ownership is separate from ALL PRIVILEGES
Auditing and lineage
Querying the audit log
SELECT event_time, user_identity.email, service_name, action_name
FROM system.access.audit
ORDER BY event_time DESC
LIMIT 100;
Lineage details
- Captured at runtime for queries in all supported languages (SQL, Python, Scala, R), down to column level.
- Visible in all workspaces attached to the same metastore.
- View it in Catalog Explorer (Lineage tab), query it in system tables, or fetch it with the REST API. Lineage data is retained for 1 year.
Other Unity Catalog features
- Delta Sharing: share tables, views, volumes, models with other organizations (open protocol) or Databricks accounts, without copying data. Objects: share, recipient, provider.
- Lakehouse Federation: a connection plus a foreign catalog lets you query MySQL, PostgreSQL, Snowflake and others in place, governed by Unity Catalog.
- System tables in the
systemcatalog: audit, billing, lineage, compute, jobs, query history. - Tags on catalogs, schemas, tables, columns; governed tags drive ABAC policies (Access control).
- Workspace-catalog binding: limit a catalog to specific workspaces (e.g. prod catalog only in prod workspace).
Trace a table drop
An external producer owns the files in a governed cloud location. Your team drops an external table pointing there. What remains, and what would you need to query it again?
Check your reasoning
The files remain in place. Re-register the table over the location or recover its catalog registration within the configured recovery period. Readers still need the relevant privileges.
Product reference
Unity Catalog quiz
Answer 7 questions. Check each answer for an explanation.