shiv
shiv

Reputation: 1

Materialized view - Viewing while refresh happens

Is it possible to select and view the existing data from materialized view while a complete refresh happens?

Upvotes: 0

Views: 1040

Answers (1)

Justin Cave
Justin Cave

Reputation: 231661

That depends on whether the refresh is atomic or not.

In an atomic refresh, Oracle behind the scenes will delete the existing data and re-insert the results. That takes longer but queries that start before the refresh finishes will see the old data. In a non-atomic refresh, Oracle behind the scenes will truncate the existing data and re-insert. That makes for a faster refresh but it means that the materialized view will be empty during the refresh.

If you are using dbms_mview.refresh, atomic is the default refresh method.

Upvotes: 2

Related Questions