What you will be able to do
- Explain what Unity Catalog controls for a managed table and what it leaves to you for an external table
- Create a managed table and an external table, and name the privileges each one needs
- Modify an existing table in place with ALTER TABLE, including its owner, tags and predictive optimization setting
- Predict what DROP TABLE does to the data files of each table type, and recover a dropped managed table with UNDROP
- Convert an external Delta table to managed with ALTER TABLE ... SET MANAGED, and roll it back with UNSET MANAGED
Key concept
Managed vs external table — Unity Catalog governs access to every table it registers. For a managed table it also decides where the data files live and runs their lifecycle, including optimizing and deleting them. For an external table you choose the storage path, and the files' lifecycle stays with you.
1.Who controls the files: governance vs lifecycle
Every table registered in Unity Catalog is governed: Unity Catalog controls who can read it, audits access to it and tracks its lineage. The real question is who controls the data files. For a managed table, Unity Catalog picks the storage path inside your cloud account and handles optimization, organization and deletion. For an external table, Unity Catalog governs access only, and you or an outside system own the files' lifecycle.
The word "manage" causes confusion because Unity Catalog uses it in three ways. "Managed by Unity Catalog" just means governed, and that covers external tables too. A managed table is narrower: Unity Catalog also owns the storage location and the data lifecycle. MANAGE is a privilege that lets a user grant or revoke privileges on an object, transfer its ownership or delete it without being the owner. Managed storage locations can be set at the metastore, catalog or schema level, and a managed table's files go into the location defined on its containing schema, catalog or metastore.
Only tables and volumes come in managed and external variants. Views, models and functions do not. Even with a managed table, the files stay in your cloud account. Unity Catalog decides where in the account they go, but it does not move them to Databricks or take ownership of them.
| Property | Managed table | External table |
|---|---|---|
| Storage location | Unity Catalog manages | You specify |
| Data lifecycle management | Unity Catalog manages | You manage |
| Automatic optimizations | Yes | Limited |
| Formats supported | Delta Lake, Apache Iceberg | Delta Lake (recommended), CSV, JSON, AVRO, PARQUET, ORC, TEXT |
| Data deleted on DROP TABLE | Yes | No |
| Best for | Production workloads, frequently queried data | Legacy integrations, existing data |
Managed tables are the default and the recommended choice. They cost less to store and query, and they maintain themselves. Several features exist only on managed tables, such as catalog commits, multi-statement transactions, automatic liquid clustering and Predictive optimization, which optimizes data layout without manual maintenance runs. Choosing managed does not lock you in: external engines can read, write and create managed tables through the Unity REST API and the Iceberg REST Catalog.
External tables are the better fit in two situations. The first is registering existing data in a format managed tables do not support, such as JSON or Avro. The second is giving non-Databricks clients direct access to the data files when they cannot use the other external access patterns. Picture a Spark cluster outside Databricks that reads Parquet files straight from an S3 path your team controls. That data belongs in an external table. Keep in mind that Unity Catalog privileges are not enforced when an outside system reads the files directly. Streaming tables and materialized views don't fit this case at all, because they are pipeline outputs, not registrations of files you own.
Checkpoint 1 of 9· Match them up
Unity Catalog uses "manage" in several ways. Match each term to what it actually means.
Tap a term, then the definition that fits it.
"Managed by Unity Catalog" only means governed, so it applies to every registered table, external ones included. "Managed table" is narrower: Unity Catalog also owns where the files are stored and what happens to them. MANAGE is a privilege, not a table type.
“When people say that an object is managed by Unity Catalog, they typically mean that Unity Catalog governs access to it.”Source: docs.databricks.com
Checkpoint 2 of 9· Exam question
An analytics team needs a Spark cluster running outside Databricks to read raw Parquet files directly from a specific S3 path they control, independent of any Databricks-managed storage lifecycle. Which Unity Catalog object type should they register the data as?
Correct answer: B — External table
- A. Incorrect. A managed table's files live at a path Unity Catalog controls and manages, which does not fit a requirement to keep data at a path the team specifies and owns.
- B. Correct. An external table stores data at a location the creator specifies and controls in cloud storage, so outside tools can keep reading it independent of Unity Catalog's managed lifecycle.
- C. Incorrect. A streaming table is a Lakeflow Spark Declarative Pipelines construct for incremental processing, not a mechanism for exposing a fixed external storage path.
- D. Incorrect. A materialized view stores precomputed query results rather than raw files at a user-controlled path, so it does not meet this requirement.
2.Creating each type: LOCATION is the difference
In SQL, the difference between the two types is one clause. A CREATE TABLE with no LOCATION creates a managed table in the schema's managed storage. You need USE CATALOG on the parent catalog, plus USE SCHEMA and CREATE TABLE on the parent schema. Add USING iceberg to get a managed Iceberg table instead of Delta.
-- Create a managed Delta table
CREATE TABLE <catalog-name>.<schema-name>.<table-name>
(
<column-specification>
);Adding LOCATION makes the table external, and that path must be covered by an external location registered in Unity Catalog. External locations are explained in Volumes and external locations as governed file sources. On top of the managed-table privileges, you need CREATE EXTERNAL TABLE on the external location that grants access to the path. Give each table its own directory, and keep the path to standard ASCII characters.
CREATE TABLE <catalog>.<schema>.<table-name>
(
<column-name> <data-type>
)
LOCATION 's3://<bucket-path>/<table-directory>';The DataFrame API works the same way. saveAsTable("<catalog>.<schema>.<table-name>") creates a managed table. Adding .option("path", "s3://...") before it creates an external table.
Each type also comes with its own maintenance rule. Managed tables must be accessed by name, such as catalog_name.schema_name.table_name. Path-based access is not supported outside Compatibility Mode, because it bypasses Unity Catalog access controls and can corrupt data. External tables can be reached by path, but if a non-Databricks client or a path-based write changes the table's metadata, Unity Catalog does not see the change. You then run MSCK REPAIR TABLE <table-name> SYNC METADATA to bring the Unity Catalog schema back in line.
Checkpoint 3 of 9· Check yourself
An engineer has USE CATALOG on the catalog, plus USE SCHEMA and CREATE TABLE on the schema. They run CREATE TABLE main.sales.orders (id INT) LOCATION 's3://acme-data/orders';. What happens?
The LOCATION clause makes the table external. That path must fall under an external location registered in Unity Catalog, and the engineer needs CREATE EXTERNAL TABLE on it in addition to the managed-table privileges. Delta is the recommended format for external tables, so no other format is required.
“The CREATE EXTERNAL TABLE privilege on an external location that grants access to the LOCATION accessed by the external table.”Source: docs.databricks.com
3.Modifying a table in place with ALTER TABLE
To modify a registered table, use ALTER TABLE rather than dropping and recreating it. Drop-then-recreate under the same name can cause errors or corrupted results for concurrent readers, while an in-place change leaves the table in the metastore throughout.
The clauses a candidate should recognise are these:
SET OWNER TO principaltransfers ownership of the table to another user, group or service principal.SET TAGSandUNSET TAGSadd and remove tags, and both need theAPPLY TAGpermission.RENAME TOgives the table a new name, which is also how you free a name before anUNDROP.ENABLE,DISABLEorINHERIT PREDICTIVE OPTIMIZATIONsets the optimization behaviour of a managed Delta table; new tables inherit the setting from their schema.SET MANAGEDandUNSET MANAGEDchange the table type itself, and are covered after the drop rules.
ALTER TABLE my_table ENABLE PREDICTIVE OPTIMIZATION;Checkpoint 4 of 9· Check yourself
A data engineer must hand an existing managed table to a new owner without interrupting the readers that query it. What is the right approach?
SET OWNER TO changes the owner in place, so the table is never dropped. Tags are labels and do not record ownership, and SET MANAGED changes the table type, not the owner.
“Transfers ownership of the table to principal.”Source: docs.databricks.com
4.What DROP TABLE deletes
DROP TABLE behaves differently because ownership of the files is different. To drop either type you must be the table's owner or hold MANAGE on it. When you drop a managed table, Unity Catalog removes it from the metastore and marks its data for deletion. After the recovery period ends, 7 days by default, the files are permanently deleted from cloud storage. They do not go to a time-travel folder, they are not handed to an external location, and nobody needs to run VACUUM.
When you drop an external table, only its metadata leaves the metastore. The files stay in place, and access to their URI is now governed by the external location that contains them. To remove the data as well, delete the files from the bucket yourself.
DROP TABLE IF EXISTS catalog_name.schema_name.table_name;If you drop a managed table by mistake, you have until the recovery period ends to get it back with UNDROP. By default it recovers the most recently dropped table with that name. The parent schema and catalog must still exist. Table privileges, the column spec and properties come back, but primary and foreign key constraints do not, so you recreate them with ALTER TABLE ADD CONSTRAINT. If several dropped tables share a name, SHOW TABLES DROPPED lists their IDs and UNDROP TABLE WITH ID restores a specific one.
UNDROP { MATERIALIZED VIEW | TABLE } { relation_name | WITH ID relation_id }You can change the recovery period with RETAIN DROPPED TO on ALTER CATALOG or ALTER SCHEMA. If both are set, the schema setting wins. Setting it to 0 hours turns off UNDROP, and the files are purged asynchronously. The setting only affects tables dropped after you change it.
Don't use drop-then-recreate to refresh a production table. Running DROP TABLE followed by CREATE TABLE ... AS SELECT under the same name can cause errors, lost records or corrupted results for concurrent readers. CREATE OR REPLACE TABLE replaces the contents in a single transaction, keeps the table's identity and history, and works the same way for managed and external tables.
Checkpoint 5 of 9· Check yourself
Two tables in the same schema are dropped on the same day: sales_managed, a managed Delta table, and sales_ext, an external Delta table at an S3 path. Two days later, the recovery period has not yet ended. Which statement describes where things stand?
For a managed table, dropping it marks the data for deletion, so UNDROP can recover it within the recovery period. For an external table, only the metadata is removed. The files stay in place, and access to their path falls under the external location that contains them.
“You can UNDROP a managed table within the configured recovery period (default 7 days).”Source: docs.databricks.com
Checkpoint 6 of 9· Exam question
A data engineer runs DROP TABLE finance.sales.transactions_managed on a managed table in Unity Catalog. What happens to the underlying data files after the command completes?
Correct answer: A — The data files are permanently deleted along with the catalog metadata, because Unity Catalog owns the storage location and lifecycle of a managed table.
- A. Correct. Unity Catalog manages the storage lifecycle of managed tables, so dropping one removes both the catalog entry and the underlying data files.
- B. Incorrect. This describes external table behavior, where only the catalog metadata is removed on drop; a managed table's files are deleted along with it.
- C. Incorrect. Dropping a table removes its transaction log along with the data files rather than preserving a 90-day recoverable history folder.
- D. Incorrect. There is no automatic transfer of files to an external location on drop; the managed table's storage is simply removed.
5.Converting external to managed with SET MANAGED
ALTER TABLE ... SET MANAGED moves an external Delta table into managed storage. The table keeps its name, settings, permissions, views and history. You could also rebuild the table with CTAS, but SET MANAGED is the recommended route. It keeps downtime short, handles writes that arrive during the conversion, redirects legacy path-based reads and writes, and can be rolled back. The prerequisites are:
- Format: the table must be Delta Lake.
- Compute: Databricks Runtime 17.3 LTS or above, or serverless.
- Permissions: you must own the table.
- Readers and writers: Databricks clients should run Runtime 15.4 LTS or above.
- Maintenance: cancel any running OPTIMIZE, liquid clustering, compaction or ZORDER jobs on the table, and don't schedule new ones until the conversion finishes.
Run DESCRIBE EXTENDED first to confirm the source really is an external table. Then the conversion is just ALTER TABLE catalog.schema.my_external_table SET MANAGED; with no extra options. It runs in two steps. First it copies the data and the Delta transaction log to the managed location while readers and writers keep working. Then it moves over any commits made during the copy and re-points the table's metadata. During that second step, writes are briefly blocked. Readers on Runtime 16.4 LTS or above see no downtime, while readers on 15.4 LTS and below might.
| Table size | Recommended cluster size | Estimated data copy time | Estimated reader and writer downtime |
|---|---|---|---|
| 100 GB or less | 32-core / X-Large SQL warehouse | ~6 min or less | ~1-2 min or less |
| 1 TB | 64-core / 2X-Large SQL warehouse | ~30 min | ~1-2 min |
| 10 TB | 256-core / 4X-Large SQL warehouse | ~1.5 hrs | ~1-5 min |
If the external table already has Iceberg reads enabled, plain SET MANAGED is the wrong command. Add TRUNCATE UNIFORM HISTORY, which truncates only the UniForm Iceberg history and leaves Delta history alone. Expect a short read and write outage for Iceberg clients after the truncation. Made-up variants such as FORCE ICEBERG or a WITH (format = ...) clause are not part of the syntax.
ALTER TABLE catalog.schema.my_external_table SET MANAGED TRUNCATE UNIFORM HISTORY;After the conversion, Catalog Explorer shows the table type as MANAGED, and predictive optimization switches on automatically unless you had turned it off. Existing read and write streams fail, so restart them with the same configuration and they pick up the path-based redirect. That redirect adds a small performance cost, so move path-based code to name-based access. Catalog Explorer can also generate a conversion notebook for one or more external tables in a schema, through Explore optimizations. This option is in Beta.
Checkpoint 7 of 9· Fill the gap
An external Delta table in Unity Catalog already has Iceberg reads enabled, and you are converting it to a managed table. Which keyword completes the command?
ALTER TABLE catalog.schema.my_external_table SET MANAGED ? UNIFORM HISTORY;When an external table already has Iceberg reads enabled, you convert it with SET MANAGED TRUNCATE UNIFORM HISTORY. This truncates only the UniForm Iceberg history and keeps the Delta history. MOVE and COPY apply only to foreign tables, and adding either one to an external-table conversion makes the command fail.
Source: docs.databricks.comCheckpoint 8 of 9· Exam question
A table has Iceberg reads enabled through Unity Catalog's Delta-to-Iceberg support. When the owner runs ALTER TABLE catalog.schema.iceberg_enabled_table SET MANAGED, the conversion fails. Which statement is required to complete the conversion?
Correct answer: A — ALTER TABLE catalog.schema.iceberg_enabled_table SET MANAGED TRUNCATE UNIFORM HISTORY;
- A. Correct. When Iceberg reads are enabled, the conversion must include
TRUNCATE UNIFORM HISTORYto truncate the Iceberg metadata history so the table can become managed. - B. Incorrect.
FORCE ICEBERGis not a recognized clause of theSET MANAGEDstatement. - C. Incorrect. A
WITH (format = ...)clause is not part of theSET MANAGEDsyntax and does not address the Iceberg history requirement. - D. Incorrect.
REPAIR TABLEis used to discover partitions in the metastore and has no role in converting a table's managed status.
Sources9
6.Rolling back with UNSET MANAGED
For 14 days after a conversion you can undo it with UNSET MANAGED, which turns the table back into an external table. It needs the same compute as the conversion: Runtime 17.3 LTS or above, or serverless. The command re-points the table's metadata to the original external location and keeps every write made to the managed location since the conversion.
ALTER TABLE catalog.schema.my_managed_table UNSET MANAGED;A few details matter after a rollback. If the command is interrupted, just run it again. Restart streaming jobs, as you did after the conversion. Commits made while the table was managed support time travel by version but not by timestamp. Seven days after the rollback, Databricks deletes the copy left in the managed location.
The order of operations is the trap. If you plan to drop a converted table and keep its data in the external path, run UNSET MANAGED first. Dropping it while it is still managed triggers managed-table drop behavior, and Databricks warns this can cause data loss or inconsistencies.
Checkpoint 9 of 9· Check yourself
A week ago a team converted an external Delta table to managed with SET MANAGED. Now they want it to be an external table at its original S3 path again, and they need to keep the rows written since the conversion. What should they do?
For 14 days after a conversion, UNSET MANAGED turns the table back into an external table. It points the metadata back to the original location and keeps the writes made while the table was managed. Dropping the table while it is still managed triggers managed-table drop behavior, which risks data loss. COPY applies only to foreign tables.
“Allows you to roll back a converted managed table to an external table.”Source: docs.databricks.com
Sources9
Practise it for real
Convert an external Delta table to managed, confirm the change, then roll it back
1.Run DESCRIBE EXTENDED on an external Delta table you own, on Databricks Runtime 17.3 LTS or above or on serverless compute.
Why: The correct SET MANAGED syntax depends on whether the source is external or foreign, so confirm the type first.
You should see: The table type shows as EXTERNAL and the location is an S3 path under an external location.
2.Run ALTER TABLE catalog.schema.my_external_table SET MANAGED; with no MOVE or COPY. If the table has Iceberg reads enabled, add TRUNCATE UNIFORM HISTORY.
Why: This copies the data and Delta log into managed storage, then switches the metadata over with only a brief pause in writes.
You should see: The command completes and Catalog Explorer shows the table type as MANAGED. Refresh the page if it still says EXTERNAL.
3.Query the table by its three-part name, then restart any streaming jobs that read from or write to it.
Why: Existing streams fail after conversion and pick up the path-based redirect only once restarted.
You should see: Name-based queries return the same rows and history as before the conversion.
4.Run ALTER TABLE catalog.schema.my_managed_table UNSET MANAGED; within 14 days.
Why: Rollback points the metadata back at the original external location and keeps writes made after the conversion.
You should see: The table shows as EXTERNAL again. Databricks deletes the managed-location copy seven days later.
Stuck? Get a nudge
If you plan to drop the table afterwards, run UNSET MANAGED before DROP TABLE, not after.
Sources
(9)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.databricks.com/aws/en/data-governance/unity-catalog/managed-versus-externalOfficial docs
“External assets: Unity Catalog controls governance only.”
↩︎ Who controls the files: governance vs lifecycle“The distinction between managed and external applies to tables and volumes only.”
↩︎ Who controls the files: governance vs lifecycle“When people say that an object is managed by Unity Catalog, they typically mean that Unity Catalog governs access to it.”
↩︎ Who controls the files: governance vs lifecycle“Managed tables use the Delta or Apache Iceberg format.”
↩︎ Who controls the files: governance vs lifecycle“This means that managed tables do not cause vendor lock-in.”
↩︎ Who controls the files: governance vs lifecycle“Managed assets: Unity Catalog controls both governance (access control, auditing, lineage) and the underlying file storage lifecycle”
↩︎ Key concept“When people say that an object is managed by Unity Catalog, they typically mean that Unity Catalog governs access to it.”
↩︎ Exam trap 4 - 2.https://docs.databricks.com/aws/en/tables/managedOfficial docs
“Automatically optimizes data layout and compute using AI, without manual maintenance operations.”
↩︎ Who controls the files: governance vs lifecycle“Path-based access to Unity Catalog managed tables is not supported (except in Compatibility Mode)”
↩︎ Creating each type: LOCATION is the difference“When you drop a managed table, Databricks deletes the data files in cloud storage after the recovery period expires (default 7 days)”
↩︎ What DROP TABLE deletes - 3.https://docs.databricks.com/aws/en/tables/externalOfficial docs
“Unity Catalog privileges are not enforced when users access data files from external systems.”
↩︎ Who controls the files: governance vs lifecycle“This location is an external location registered in Unity Catalog.”
↩︎ Creating each type: LOCATION is the difference“The CREATE EXTERNAL TABLE privilege on an external location that grants access to the LOCATION accessed by the external table.”
↩︎ Creating each type: LOCATION is the difference“you must run MSCK REPAIR TABLE <table-name> SYNC METADATA to bring the schema in Unity Catalog up to date”
↩︎ Creating each type: LOCATION is the difference“To drop a table you must be its owner or have the MANAGE privilege on the table.”
↩︎ What DROP TABLE deletes“You must directly delete the underlying data files if you need to remove data associated with the table.”
↩︎ Exam trap 1“You must directly delete the underlying data files if you need to remove data associated with the table.”
↩︎ Prediction - 4.https://docs.databricks.com/aws/en/tables/typesOfficial docs
“Databricks recommends that you use the Delta Lake format because it has transactional guarantees and performance optimizations that the other formats don't.”
↩︎ Who controls the files: governance vs lifecycle - 5.
“Transfers ownership of the table to principal.”
↩︎ Modifying a table in place with ALTER TABLE“You need to have APPLY TAG permission to add tags to the table.”
↩︎ Modifying a table in place with ALTER TABLE“Alters the managed Delta Lake table to the desired predictive optimization setting.”
↩︎ Modifying a table in place with ALTER TABLE - 6.
“Databricks doesn't recommend that you drop and then recreate a table using the same name for production pipelines or systems”
↩︎ Modifying a table in place with ALTER TABLE“The table is removed from the metastore and underlying data is marked for deletion.”
↩︎ What DROP TABLE deletes“URI access privileges are now governed by the external location that contains the data.”
↩︎ What DROP TABLE deletes“CREATE OR REPLACE TABLE has the same semantics regardless of the table type or metastore in use.”
↩︎ What DROP TABLE deletes“You can UNDROP a managed table within the configured recovery period (default 7 days).”
↩︎ Checkpoint - 7.
“By default, this feature supports recovering dropped relations within a 7 day recovery period.”
↩︎ What DROP TABLE deletes“Primary and foreign key constraints are not recovered by the UNDROP command.”
↩︎ What DROP TABLE deletes - 8.https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-alter-catalogOfficial docs
“If a recovery period is also set on a child schema, the schema-level setting takes precedence for tables in that schema.”
↩︎ What DROP TABLE deletes - 9.
“The conversion retains table configurations, including name, settings, permissions, and views, and retains table history.”
↩︎ Converting external to managed with SET MANAGED“Databricks recommends SET MANAGED for the preceding benefits.”
↩︎ Converting external to managed with SET MANAGED“Runtime: You must use Databricks Runtime 17.3 LTS or above or Serverless compute to use SET MANAGED, UNSET MANAGED, or TRUNCATE UNIFORM HISTORY.”
↩︎ Converting external to managed with SET MANAGED“Permissions: Ownership of the table.”
↩︎ Converting external to managed with SET MANAGED“cancel any existing OPTIMIZE command jobs (liquid clustering, compaction, ZORDER) operating on your external table”
↩︎ Converting external to managed with SET MANAGED“During this step, all writes to the external location are temporarily blocked, resulting in writer downtime.”
↩︎ Converting external to managed with SET MANAGED“TRUNCATE UNIFORM HISTORY truncates UniForm Iceberg history only and doesn't remove Delta history.”
↩︎ Converting external to managed with SET MANAGED“After table conversion, existing read and write streams fail.”
↩︎ Converting external to managed with SET MANAGED“Predictive optimization is automatically enabled after conversion unless you manually turned it off.”
↩︎ Converting external to managed with SET MANAGED“After converting an external table to a managed table, you can roll back within 14 days by using the UNSET MANAGED command.”
↩︎ Rolling back with UNSET MANAGED“Databricks preserves all writes made to the managed location after conversion.”
↩︎ Rolling back with UNSET MANAGED“Seven days after rollback, Databricks automatically deletes data in the managed location.”
↩︎ Rolling back with UNSET MANAGED“You MUST run UNSET MANAGED before dropping the managed table.”
↩︎ Rolling back with UNSET MANAGED“If you add MOVE or COPY options when converting an external table, the command fails with DELTA_ALTER_TABLE_SET_MANAGED_UNSUPPORTED_COPY_MOVE_SYNTAX.”
↩︎ Exam trap 2“Include TRUNCATE UNIFORM HISTORY to maintain optimal table performance and compatibility.”
↩︎ Exam trap 3“If you add MOVE or COPY options when converting an external table, the command fails with DELTA_ALTER_TABLE_SET_MANAGED_UNSUPPORTED_COPY_MOVE_SYNTAX.”
↩︎ Prediction“Allows you to roll back a converted managed table to an external table.”
↩︎ Checkpoint