alterMaterializedViewMaintenance

Suspends or resumes automatic maintenance of a materialized view in Snowflake. Materialized views require Snowflake Enterprise Edition or higher.

Note: Automatic rollback toggles the maintenance state back.

Known limitation: This change type does not support database inspection features (snapshot, diff, diff-changelog, and generate-changelog commands).

Available attributes

Attribute

Type

Description

Required

catalogName

String

Name of the catalog (database) containing the materialized view

No

schemaName

String

Name of the schema containing the materialized view

No

viewName

String

Name of the materialized view to alter

Yes

operation

String

Operation to perform: SUSPEND or RESUME

Yes

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:pro-snowflake="http://www.liquibase.org/xml/ns/pro-snowflake"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
        http://www.liquibase.org/xml/ns/pro-snowflake
        http://www.liquibase.org/xml/ns/pro-snowflake/liquibase-pro-snowflake-latest.xsd">
  <!-- Suspend maintenance -->
  <changeSet id="mv-suspend-maintenance" author="examples">
    <pro-snowflake:alterMaterializedViewMaintenance
                viewName="MV_SALES_SUMMARY"
                operation="SUSPEND"/>
  </changeSet>
  <!-- Resume maintenance -->
  <changeSet id="mv-resume-maintenance" author="examples">
    <pro-snowflake:alterMaterializedViewMaintenance
                viewName="MV_SALES_SUMMARY"
                operation="RESUME"/>
  </changeSet>
  <!-- With schema qualification -->
  <changeSet id="mv-maintenance-qualified" author="examples">
    <pro-snowflake:alterMaterializedViewMaintenance
                catalogName="MY_DATABASE"
                schemaName="ANALYTICS"
                viewName="MV_REPORTS"
                operation="SUSPEND"/>
  </changeSet>
</databaseChangeLog>

alterMaterializedViewMaintenance - Liquibase