Materialized View – Oracle

materialized-vieworacle

I have materialized view for which i want to alter its refresh time:

REFRESH FORCE START WITH SYSDATE NEXT SYSDATE +1 DISABLE QUERY REWRITE 

I want to know few things in this.

  1. What does NEXT SYSDATE +1 depict?
  2. How am I going to change it (e.g after every 6 hours)?
  3. What is DISABLE QUERY REWRITE?

Best Answer

NEXT SYSDATE +1 means the materialized view will be automatically refreshed every day at the same time when the view is created.

In order to refresh the materialized view every 6 hours use NEXT SYSDATE +6/24

DISABLE QUERY REWRITE indicates that the materialized view is not eligible to be used by the query optimizer to rewrite sql queries on the base tables.