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


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *