A materialized view provides indirect access to table data by storing the results of a query in a separate schema object. Unlike an ordinary view, which does not take up any storage space or contain any data, a materialized view contains the rows resulting from a query against one or more base tables or views. A materialized view can be stored in the same database as its base tables or in a different database.
Materialized views are often used to improve performance, especially when storing data locally that is sourced from tables or views using a database link. Similarly, materialized views are often used instead of views when there are extensive calculations or summarizations, especially on particularly large data sets. Materialized views are refreshed at specified intervals which means the data is not always up-to-date but queries against them are significantly faster for the examples given above.
Topics:
Oracle Database Concepts for information about materialized views
To create a materialized view:
On the Workspace home page, click SQL Workshop and then Object Browser.
Object Browser appears.
Click Create.
From the list of object types, select Materialized View.
Define the materialized view:
Materialized View Name - Enter a name.
Query - Specify a query to define the view.
To access Query Builder or SQL Command Processor, click the appropriate link at the bottom of the page. The selected tool appears in a pop-up window. Once you generate the appropriate SQL, click Return to automatically close the popup window and return to the wizard with the SQL.
Click Next.
A confirmation page appears, which displays the SQL used to create the materialized view.
Click Create Materialized View.
To view a materialized view:
On the Workspace home page, click SQL Workshop and then Object Browser.
Object Browser appears.
From the Object list, select Materialized Views.
From the Object Selection pane, select a view.
The Materialized View appears.
Click the tabs at the top of the page to view different reports about the materialized view. Table 1-12 describes all available views.
Table 1-12 Available Views for Materialized View
To drop a materialized view in Object Browser:
On the Workspace home page, click SQL Workshop and then Object Browser.
Object Browser appears.
From the Object list, select Materialized Views.
From the Object Selection pane, select a view.
The Materialized View appears.
Click Drop.
To confirm, click Finish.