All Products
Search
Document Center

MaxCompute:ALTER VIEW

Last Updated:Mar 26, 2026

Renames a view or changes its owner.

Synopsis

alter view <view_name> rename to <new_view_name>;
alter view <view_name> changeowner to <new_owner>;

Rename a view

Renames an existing view.

Syntax

alter view <view_name> rename to <new_view_name>;

Parameters

ParameterRequiredDescription
view_nameYesThe name of the view to rename.
new_view_nameYesThe new name of the view. If a view with the same name already exists, an error is returned.

Example

-- Rename the sale_detail_view view to market.
alter view sale_detail_view rename to market;

Change the owner of a view

Changes the owner of an existing view.

Syntax

alter view <view_name> changeowner to <new_owner>;

Parameters

ParameterRequiredDescription
view_nameYesThe name of the view whose owner you want to change.
new_ownerYesThe new owner of the view.

Example

-- Change the owner of the sale_detail_view view to ALIYUN$xxx@aliyun.com.
alter view sale_detail_view changeowner to 'ALIYUN$xxx@aliyun.com';

Related topics

  • CREATE VIEW: Creates a view or updates an existing view based on a query statement.

  • DESC VIEW: Views the information about an existing view.

  • DROP VIEW: Drops an existing view.