yyds
yyds

Reputation: 17

How can update a materialized view at a certain time in oracle?

For examle, I want to update the following materialized view everyday at 23:30. What should I write after the START WITH and NEXT clause ?

CREATE MATERIALIZED VIEW test_example REFRESH COMPLETE  
       START WITH 
       NEXT
AS

Upvotes: 1

Views: 1030

Answers (2)

tlauss
tlauss

Reputation: 1

Simplified answer of @Littlefoot:

edit: addition: if you want it to start today at 23:30 you would go like

create materialized view test_example
refresh complete
start with trunc(sysdate) + 23.5/24
next trunc(sysdate) + 23.5/24 + 1
as select ...

Upvotes: 0

Littlefoot
Littlefoot

Reputation: 142733

Start right now, and do it every day at 23:30 as

create materialized view test_example
refresh complete
start with sysdate 
next trunc(sysdate) + 23/24 + 30/(24*60)
as select ...

Upvotes: 0

Related Questions