This topic describes how to drop a materialized view by using SQL statements.
Required privileges
You need the DROP TABLE privilege to drop a materialized view. For more information about privileges in OceanBase Database, see Privilege types in Oracle mode.
Considerations
A materialized view that is separately dropped is not moved to the recycle bin.
Syntax
The syntax for dropping a materialized view is as follows:
DROP MATERIALIZED VIEW [ schema. ] materialized_view;
Parameters
| Parameter | Description |
|---|---|
| schema. | The schema where the materialized view is located. This parameter is optional. If you do not specify the schema. parameter, the system assumes by default that the materialized view resides in your own schema. |
| materialized_view | The name of the materialized view. |
Example
Drop the materialized view named mv_test_tbl1.
DROP MATERIALIZED VIEW mv_test_tbl1;
The return result is as follows:
Query OK, 0 rows affected