0
votes

If a materialized view is created as FAST refresh in Oracle. Does doing a FORCE refresh in this MV, does COMPLETE refresh incase FAST refresh fails due to some issues?

DBMS_MVIEW.REFRESH('MV_NAME');

Will this statement do a COMPLETE refresh incase FAST refresh fails. The view is created as FAST refresh.

1
Yes this is what the official document says also, docs.oracle.com/database/121/DWHSG/…. - Sujitmohanty30

1 Answers

0
votes

If you do not specify a refresh method in your command, then it will default to the defined method for the mview. If you want 'FORCE' (which is never a default), then you need to specify that in your command:

dbms_mview.refresh('MV_NAME','?');

Generally speaking it is always good to specify what you want explicitly rather than leave things up to defaults. Default actions sometimes change over time, and may not be readily understandable to someone else trying to make sense of your code.

See documentation on dbms_mview.refresh here: https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_MVIEW.html#GUID-DD332F65-A5BC-4DE6-814E-EAE2E0275F3D