Oracle Views vs Materialized views

Oracle Views vs Materialized views

Oracle database has various objects like tables, Triggers, views ,Materialized views.
This has information on oracle views vs materialized views.

ViewsMaterialized Views
View is a logical table based on one or more tables or views.Materialized view is a replica of a target table

from a single point in time.

A view contains no data itself.Materialized view contains data also
The tables upon which a view is based are called base tables.Materialized views are updated from the target

table through individual batch updates, known as a refreshes.

Example:
CREATE VIEW emp_view AS
SELECT last_name, salary*12 annual_salary
FROM employees
WHERE department_id = 20;
Example:
CREATE MATERIALIZED VIEW MV_employees
BUILD IMMEDIATE
REFRESH FORCE
ON DEMAND
AS
SELECT * FROM hr.employees@orcl.example.com;
Drop view emp_view;DROP MATERIALIZED VIEW MV_EMPLOYEES;
select view_name, text from USER_VIEWS where view_name=’EMP_VIEW’ ;select MVIEW_NAME,QUERY

from USER_MVIEWS

where MVIEW_NAME=’MV_EMPLOYEES’;

Reference: https://docs.oracle.com/cd/B28359_01/server.111/b28286

/statements_8004.htm

Reference: https://docs.oracle.com/cd/B28359_01/server.111/

b28326/repmview.htm

 

check our” Youtube channel videos” on oracle database 

June 7, 2018

0 responses on "Oracle Views vs Materialized views"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Template Design © VibeThemes. All rights reserved.