Updated on 2024-12-13 GMT+08:00

ALTER MATERIALIZED VIEW STATUS

Syntax

ALTER MATERIALIZED VIEW qualifiedName SET STATUS <status>

Description

To change the status of a materialized view, you can only convert between ENABLE and SUSPEND. The DISABLE state can be changed to SUSPEND or ENABLE only. The statuses of materialized views include:

  • INIT: The materialized view is created for the first time.
  • SUSPEND: The materialized view is suspended. The suspended materialized view is not rewritten.
  • ENABLE: The materialized view is available.
  • REFRESHING: The materialized view data is being refreshed and cannot be rewritten.
  • DISABLE: The materialized view is disabled.

Example

Change the status of mv.default.mv1 to SUSPEND.

alter materialized view mv.default.mv1 set status SUSPEND;