1

I am working with an Oracle 11g view to read data from. My question is, How often does this view gets updated? does it get updated every time it is open for read? or does it get updated every time a change occurs in the tables in which they are used in the view? or ....

Your help is really appreciated.

user2597012
  • 581
  • 4
  • 9
  • 28
  • 3
    `Views` don't store data. They are queries against the system. So they should always be "Current". `Materialized views` on the other hand, STORE data and what data they have depends on their update schedule. Views always read from the sources defined in the view's DDL (data definition language); thus are "real time" in relation to data in the table at the time the query was executed against the view. – xQbert May 15 '17 at 13:30
  • More detail: http://stackoverflow.com/questions/93539/what-is-the-difference-between-views-and-materialized-views-in-oracle – xQbert May 15 '17 at 13:36

1 Answers1

4

In general in SQL views are not in ANY sense cached storage of the data - they are more like a syntax shorthand for complex queries. Specifically the views are executed more like a select statement at the time the view is queried - thus the data is the view is always up-to-date with the underlying tables because when you query a view you get the data directly from those underlying tables not as you imagine from some kind of cache of the view data that might be out of date.

Elemental
  • 7,365
  • 2
  • 28
  • 33