Thanks for the question, Mikhail.
Asked: June 13, 2016 - 4:36 pm UTC
Last updated: June 14, 2016 - 4:16 am UTC
Version: 12.1.0.2.0
Viewed 1000+ times
You Asked
Hello Tom,
I am creating a materialized view and want it to refresh automatically daily at 2 AM.
So I am creating it using this approach:
create materialized view <mv_name> REFRESH NEXT (TRUNC(SYSDATE)+1+2/24) as
select ...
When oracle refreshes it automatically using complete refresh (I do not have MV logs), I want oracle to do truncate / insert /*+ append */.
I know that the MV can be refreshed the way I want by manually executing DBMS_MVIEW.refresh(<mv_name>, atomic_refresh=>false);
Is there an option when an MV is created to specify that this is how I want it to be refreshed automatically? If it exists, I could not find it.
Thank you,
Mikhail
and Connor said...
To my knowledge, there is nothing in the DDL to allow for this.
This is one of the reasons we often move such features to PL/SQL packages, because the greater flexibility. Think of dbms_stats. We did that because the continually extend the "analyze" command just would have got too unwieldy.
Rating
(1 rating)
Is this answer out of date? If it is, please let us know via a Comment