[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Views Creation

Posted on 2004-11-20
8
Medium Priority
?
590 Views
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.
0
Comment
Question by:pooja74
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:Tony_Hasler
ID: 12635862
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.

CREATE MATERIALIZED VIEW sales_mv
   BUILD IMMEDIATE
   REFRESH COMPLETE ON DEMAND
   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;

0
 

Author Comment

by:pooja74
ID: 12639986
Thx for the reply ,But please include the syntax also  the clause for refresh of the view  in every two hours also.
Thx
0
 
LVL 6

Expert Comment

by:Eladla
ID: 12640383
The syntax is:

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

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

Author Comment

by:pooja74
ID: 12641547
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.,
0
 
LVL 6

Accepted Solution

by:
Eladla earned 400 total points
ID: 12642421
http://www.dbasupport.com/oracle/ora9i/ManRefreshMViews2.shtml

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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
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…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

865 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