Skip to main content

SET MANAGED LOCATION (FOREIGN SCHEMA)

Applies to: check marked yes Databricks Runtime 17.3 and above

Preview

This feature is in Public Preview and is only available to participating customers at this time. To participate in the preview, apply by filling out this form. This feature only supports modifying managed locations for schemas in foreign catalogs using HMS and Glue Federation.

Use the ALTER SCHEMA SET MANAGED LOCATION command to modify the default location used in cloud storage when you create new managed tables in Unity Catalog schemas. This change doesn't affect existing objects in the schema.

Requires OWNER or MANAGE permissions on the schema.

Syntax

SQL
ALTER SCHEMA schema_name SET MANAGED LOCATION 'path'

Parameters

  • schema_name

    The name of the schema to modify. Can be a fully qualified name (catalog_name.schema_name) or just the schema name if the catalog is already selected.

  • path

    The cloud storage path to use as the default location for new managed tables created in this schema. Must be a valid cloud storage location (e.g., s3://bucket/path, abfss://container@account.dfs.core.windows.net/path, gs://bucket/path).

Examples

SQL
-- Set managed location for a schema in a foreign catalog
> ALTER SCHEMA hms_federated_catalog.my_schema SET MANAGED LOCATION 's3://my-bucket/managed-tables/';
OK

-- Set managed location using fully qualified schema name
> ALTER SCHEMA my_catalog.my_schema SET MANAGED LOCATION 'abfss://container@account.dfs.core.windows.net/managed/';
OK

Verify configuration

You can confirm the managed location for a schema:

SQL
DESCRIBE SCHEMA EXTENDED hms_federated_catalog.my_schema;

The output shows the managed location in the Location field.