enq: MS – contention Oracle等待

当物化视图刷新时,可能出现大量的enq:ms等待事件

 

 

The event is raised because the MV is recompiled.
The alter summary compile is fired because the MV is created with query rewrite enabled.
The select query on the base table will try rewriting with the MV. But since MV is being refreshed, its invalid
and therefore compile statement is fired.

This is what is causing the wait event to be raised.
Therefore this was considered to be working as designed.
However, there is a useful solution for this

If you recreate your MV log with the ‘COMMIT SCN’ option, then this event should be gone
or at least drastically reduced.
This is described at

http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_6003.htm#SQLRF01303

Comment

*

沪ICP备14014813号

沪公网安备 31010802001379号