We just ran into a problem where materialized views weren't refreshing, and giving a compile error. One of the senior developers says he just figured out how to fix it -- by telling toad to compile the materialized view.
So my question is pretty simple: what's the difference between a refresh and a "compile"?
A Refresh of a materialized view is a data operation. The data in the MV is brought up to date as specified when the view was created, e.g., fast refresh, complete refresh, etc.
When you compile the MV, Oracle revalidates the query upon which the view is based. Your MV may be invalid due to changes in one or more of the underlying objects upon which the MV is based.
A refresh updates the data that the materialized view holds. This cannot be done if the materialized view's definition is invalid.
A compile validates the definition of the materialized view, i.e. that the SQL is valid and that the objects it relies on exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With