This topic describes how to drop a materialized view log by using SQL statements.
Note
When you drop a materialized view log, if a transaction is running on the base table, the drop operation is blocked until the transaction is completed.
Required privileges
You need the DROP TABLE privilege to drop a materialized view log. For more information about privileges in OceanBase Database, see Privilege types in MySQL mode.
Considerations
A materialized view log that is separately dropped is not moved to the recycle bin.
Syntax
The syntax for dropping a materialized view log is as follows:
DROP MATERIALIZED VIEW LOG ON [database.] table;
Parameters
| Parameter | Description |
|---|---|
| database. | The database where the base table of the materialized view log is located. If you do not specify the database. parameter, the database in which you execute the statement is used by default. |
| table | The name of the base table of the materialized view log. |
Example
Drop the materialized view log on the test_tbl1 table.
DROP MATERIALIZED VIEW LOG ON test_tbl1;
The return result is as follows:
Query OK, 0 rows affected