Views Creation

Posted on 2004-11-20
Last Modified: 2007-12-19
Please write me the steps to create the materilized views.I have five views to be created as materilized views.I want to place them in DBMS_REFRESH to get refreshed together.
I want to do refresh  of views in every two hours.
Thx in advance.
Question by:pooja74
    LVL 2

    Expert Comment

    I am not sure what you want.  There are a lot of options for materialized views.  For instance, the following is a modified example of an aggregate view from the Oracle documentation.  You can then refresh it by using the DBMS_REFRESH package.

    Is it the DBMS_REFRESH package that you need help on?  If not could you be more specific about what you want, and I can perhaps give you the SQL.

       AS SELECT t.calendar_year, p.prod_id,
          SUM(s.amount_sold) AS sum_sales
          FROM times t, products p, sales s
          WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id
          GROUP BY t.calendar_year, p.prod_id;


    Author Comment

    Thx for the reply ,But please include the syntax also  the clause for refresh of the view  in every two hours also.
    LVL 6

    Expert Comment

    The syntax is:

    Create materialized view [view name]
    refresh fast next sysdate + 1/12
    select ...
    from ...
    where ...

    this will do a fast refresh every two H`s, starting from two H`s after view creation.

    Author Comment

    Thx please send me the syntax for creation of group in dbms_refresh and using dbms_refesh for the group.And when we are using dbms_refresh we should use use refresh fast next sysdate + 1/12  in view or not.And if we not using then what is the syntax for creation of  materilaized view with dbms_refresh.
    This is urgent please reply.
    Thx in advance.,
    LVL 6

    Accepted Solution


    Here is the full syntax plus examples of the dbms_refresh procedure.

    As for the view creation, if you don`t want it to do an automatic refresh, just omit the refresh clause and use the dbms_refresh to do it manualy.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Suggested Solutions

    Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
    Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
    This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
    This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now