A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

ORA-04021: timeout occurred while waiting to lock object while dropping Materialized View.

1 min read

A materialized view, or snapshot as they were previously known, is a table segment whose contents are periodically refreshed based on a query, either against a local or remote table.

SQL> drop materialized view HR.EMPLOYEES ;
	ERROR at line 1:
	ORA-04021: timeout occurred while waiting to lock object 
  

To resolve this issue, we have to drop materialized view summary first:

SQL> drop summary HR.EMPLOYEES;
	Summary dropped.

SQL> drop materialized view HR.EMPLOYEES;
	Materialized view dropped.