Skip to content

Instantly share code, notes, and snippets.

@shaik2many
Last active August 29, 2015 13:56
Show Gist options
  • Save shaik2many/8866188 to your computer and use it in GitHub Desktop.
Save shaik2many/8866188 to your computer and use it in GitHub Desktop.
Materialized view
CREATE MATERIALIZED VIEW xxxxx
REFRESH COMPLETE
START WITH TO_DATE('07-FEB-2014 08:00:00','dd-mon-yyyy hh24:mi:ss')
NEXT (SYSDATE +4/24)
AS
select * from table1
(here 4 is the frequency - every 4 hours)
---- starts at 2am next day and runs everyday at 2am
ALTER MATERIALIZED VIEW my_mv
REFRESH COMPLETE
START WITH TRUNC(SYSDATE+1)+2/24
NEXT SYSDATE+1;
SELECT TRUNC(SYSDATE+1)+1/24 FROM dual;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment