HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Oracle materialized view refresh schedule

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
materializedrefreshvieworacleschedule

Problem

Since I see that it is possible to specify an expression like sysdate + 1, here are my questions:

-
Is it possible to specify the exact time of the refresh for materialized views in oracle?

-
Is it possible that it all starts at 2 a.m. while there is nobody using the db from my application?

Solution

Your expression can be as complicated as you'd like so you can certainly specify that the refresh should happen every day at 2 AM, i.e.

NEXT trunc(sysdate+1) + interval '2' hour


will specify that the refresh happens every day at 2 AM. The expression is evaluated at the conclusion of each refresh so you just need to ensure that the expression evaluates to whatever time you want at that particular instant in time.

Code Snippets

NEXT trunc(sysdate+1) + interval '2' hour

Context

StackExchange Database Administrators Q#1889, answer score: 8

Revisions (0)

No revisions yet.