| mv_name | yes | The name of the materialized view to alter. |
| new_refresh_scheme_desc | no | New refresh strategy, see SQL Reference - CREATE MATERIALIZED VIEW - Parameters for details. |
| new_mv_name | no | New name for the materialized view. |
| ACTIVE | no | Set the status of the materialized view to active. The database automatically sets a materialized view to inactive if any of its base tables is changed, for example, dropped and re-created, to prevent the situation that original metadata mismatches the changed base table. Inactive materialized views cannot be used for query acceleration or query rewrite. You can use this SQL to activate the materialized view after changing the base tables. |
| INACTIVE | no | Set the status of the materialized view to inactive. An inactive asynchronous materialized view cannot be refreshed. But you can still query it as a table. |
| SWAP WITH | no | Perform an atomic exchange with another asynchronous materialized view after necessary consistency checks. |
| ORDER BY | no | Change the sort key of the materialized view to the listed columns online, without recreating the materialized view. Supported only for range-distributed asynchronous materialized views in shared-data clusters (from v4.2 onwards). On a materialized view with colocate_with, the new sort key must start with the colocated columns, in the same order and with the same types. If colocate_with specifies only the colocation group and the new sort key is longer than the colocated columns, the property is rewritten to the explicit form <colocation_group>:<colocated_column>[,<colocated_column>], which SHOW CREATE MATERIALIZED VIEW returns from then on. The listed columns must be output columns of the materialized view. For Duplicate Key materialized views the sort key can be any subset of the columns; for Aggregate and Unique Key materialized views the sort key must consist of exactly the key columns. The materialized view’s refresh is paused for the duration of the rewrite and resumed automatically when it completes; the materialized view remains queryable throughout and the new sort order takes effect atomically. |
| key | no | The name of the property to alter, see SQL Reference - CREATE MATERIALIZED VIEW - Parameters for details. NOTE If you want to alter a session variable-related property of the materialized view, you must add a session. prefix to the property, for example, session.insert_timeout. You do not need to specify the prefix for non-session properties, for example, mv_rewrite_staleness_second. |
| value | no | The value of the property to alter. |