Jaa


ALTER VOLUME

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 13.3 LTS and above check marked yes Unity Catalog only

Alters the name or owner of a volume.

Syntax

ALTER VOLUME volume_name
      { RENAME TO new_volume_name |
        [ SET ] OWNER TO principal |
        SET TAGS clause |
        UNSET TAGS clause }

Parameters

  • volume_name

    The name of the volume to be altered.

  • RENAME TO new_volume_name

    Renames volume_name to new_volume_name. The new name must be unique and the schema must not change.

  • [ SET ] OWNER TO principal

    Transfers ownership of the volume to principal.

    SET is allowed as an optional keyword.

  • SET TAGS ( { tag_name = tag_value } [, ...] )

    Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 14.3 and above

    Apply tags to the volume. You need to have APPLY TAG permission to add tags to the volume.

    • tag_name

      A literal STRING. The tag_name must be unique among all tags associated with the specified volume.

    • tag_value

      A literal STRING.

  • UNSET TAGS ( tag_name [, ...] )

    Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 14.3 and above

    Remove tags from the volume. You need to have APPLY TAG permission to remove tags from the volume.

    • tag_name

      A literal STRING. The tag_name must be unique among all tags associated with the specified volume.

Examples

- Change the owner of the volume `my_volume`
> ALTER VOLUME my_volume SET OWNER TO alf@melmak.et
  OK

- Change the name of the volume from `my_volume` to `new_name_volume`
> ALTER VOLUME my_volume RENAME TO new_name_volume
  OK

-- Applies three tags to the volume named `my_volume`.
> ALTER VOLUME my_volume SET TAGS ('tag1' = 'val1', 'tag2' = 'val2', 'tag3' = 'val3');
  OK

-- Removes three tags from the volume named `my_volume`.
> ALTER VOLUME my_volume UNSET TAGS ('tag1', 'tag2', 'tag3');
  OK