CertSafari
    Databricks Certified Data Engineer Associate· Lessons

    Domain 7 · Lesson 30/33

    Managed vs external tables in Unity Catalog

    Differentiate between managed and external tables in Unity Catalog and perform basic operations (create, modify, delete, and convert between managed and external tables) on them

    20 min read
    3.75% of exam
    9 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    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.

    Managed and external tables compared
    PropertyManaged tableExternal table
    Storage locationUnity Catalog managesYou specify
    Data lifecycle managementUnity Catalog managesYou manage
    Automatic optimizationsYesLimited
    Formats supportedDelta Lake, Apache IcebergDelta Lake (recommended), CSV, JSON, AVRO, PARQUET, ORC, TEXT
    Data deleted on DROP TABLEYesNo
    Best forProduction workloads, frequently queried dataLegacy 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.

    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?

    Sources1234

    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.

    A managed Delta table: no LOCATION, so Unity Catalog picks the pathsql
    -- 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.

    An external table: the LOCATION clause points at a path you controlsql
    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?

    Sources32

    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 principal transfers ownership of the table to another user, group or service principal.
    • SET TAGS and UNSET TAGS add and remove tags, and both need the APPLY TAG permission.
    • RENAME TO gives the table a new name, which is also how you free a name before an UNDROP.
    • ENABLE, DISABLE or INHERIT PREDICTIVE OPTIMIZATION sets the optimization behaviour of a managed Delta table; new tables inherit the setting from their schema.
    • SET MANAGED and UNSET MANAGED change the table type itself, and are covered after the drop rules.
    Modifying a managed table: turn on predictive optimizationsql
    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?

    Sources56

    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.

    Dropping a table: the same statement for both typessql
    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 syntax: recover by name or by table IDsql
    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?

    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?

    Sources62378

    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.

    Estimated SET MANAGED timings by table size
    Table sizeRecommended cluster sizeEstimated data copy timeEstimated reader and writer downtime
    100 GB or less32-core / X-Large SQL warehouse~6 min or less~1-2 min or less
    1 TB64-core / 2X-Large SQL warehouse~30 min~1-2 min
    10 TB256-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.

    Converting an external table that has Iceberg reads enabledsql
    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;

    Checkpoint 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?

    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.

    Rolling a converted table back to externalsql
    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?

    Sources9

    Practise it for real

    Convert an external Delta table to managed, confirm the change, then roll it back

    1. 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. 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. 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. 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. 1.
      “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. 2.
      “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. 3.
      “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. 4.
      “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. 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. 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. 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. 8.
      “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. 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

    Spotted a mistake, or was something unclear? Tell us.