Prev | Current Page 892 | Next

Richard Niemiec

"Oracle Database 10g Performance Tuning Tips & Techniques"


Because the fast refresh just applies changes made since the last refresh, the time taken to perform
the refresh should generally be very short.
In a complete refresh, the data within the materialized view is completely replaced each time
the refresh is run. The time required to perform a complete refresh of the materialized view can
be substantial. You can either have the refresh performed each time transactions are committed
on the master table (refresh on commit) or only when the DBMS_MVIEW.REFRESH procedure is
run (refresh on demand).
When you specify force refresh, the refresh process first evaluates whether or not a fast refresh
can be run. If it can??™t, a complete refresh will be performed. If you specify never refresh as the
refresh option, the materialized view will not be refreshed.
If you do not have a materialized view log created and populated, only complete refreshes
can be executed.
Creating a Materialized View
A sample command used to create the materialized view is shown in the following listing. In
this example, the materialized view is given a name (STORE_DEPT_SAL_MV) and its storage
parameters are specified as well as its refresh interval and the time at which it will be populated
with data. In this case, the materialized view is told to use the complete refresh option and to not
populate the data until the DBMS_MVIEW.REFRESH procedure is run. Query rewrite is enabled.
This materialized view??™s base query is as follows:
create materialized view STORE_DEPT_SAL_MV
tablespace MVIEWS
build deferred
refresh complete
enable query rewrite
as
select d.


Pages:
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904
kwatery prywatne przyczepy campingowe Konwertery tanie noclegi nad morzem rewal wanna poolspa