Oracle Materialized View Refresh Group – Montly Interval

oracle

I have a few Materialized Views that I need to update weekly and monthly.

So for the weekly I'm using:

execute DBMS_REFRESH.MAKE(
name=>'LPMVRefresh_Weekly_1',
list=>'mySchema.MV1_mv,mySchema.MV2_mv',
next_date => TO_DATE('2013-09-08:00:30:00','YYYY-MM-DD:HH24:MI:SS'),
interval =>'sysdate+7');

How can I do so they refresh monthly, say every 1st of the month at 1 am? Is there something like Interval => sysdate+monthly?

Best Answer

Next month's 1st day 1am can be calculated using the following SQL:

SELECT TRUNC(ADD_MONTHS(SYSDATE,1), 'MONTH')+1/24 AS ANSWER FROM DUAL;

The most probably it can be simplified.