Oracle Articles, Oracle Tools, Oracle Tips, Database Articles and DBA Tips  

The Largest Online Resource for Oracle Articles, Oracle Tips, Oracle Scripts & Oracle Tools!!


Enter your Email:
 
Navigate at FreeMegaZone Home      Articles      Tools      Jobs      Games      Support      Submit Content      Advertise
Advertise at http://www.articles.freemegazone.com

Advertise at FreeMegaZone

Give tremendous boost to your business by advertising at FreeMegaZone. Contact webmaster@freemegazone.com

 

Rating: *****                                             Rate this article:    

Author: Don Burleson

Page: 1 2 3

Materialized views are amongst the most significant SQL tuning tools that allow you to pre-join complex views and pre-compute summaries for super-fast response time. Although they are complex still they play an important role in reducing repetitive I/O.  In this article I will give some effective tips for materialized views.

Materialized views in Oracle:

  • Materialized views were first introduced in Oracle8.
  • Materialized views were enhanced in Oracle9 i to allow very fast dynamic creation of complex objects.
  • Materialized views allow sub-second response times by pre-computing aggregate information and Oracle9 i dynamically rewrites SQL queries to reference existing materialized views.
  • Without materialized views many unnecessary repeating large-table full-table scans are seen as summaries are computed, over and over.

Using materialized views:

Special initialization parameters must be set and special authority must be granted to the users of materialized views in order to use them.

Below code shows how to set initialization parameters within Oracle to enable the mechanisms for materialized views and query rewrite.

optimizer_mode = choose, first_rows, or all_rows
job_queue_interval = 3600
job_queue_processes = 1
query_rewrite_enabled = true
query_rewrite_integrity = enforced
compatible = 8.1.5.0.0 (or greater)

query_rewrite_integrity:

If the CURSOR_SHARING parameter is set to FORCE, some rewrites that were text-match based in 8.1.5 may no longer be possible with 8.1.6. There are three acceptable values for query_rewrite_integrity

trusted

Assumes that the materialized view is current

enforced (default)

Always goes to materialized view with fresh data

stale_tolerated

Uses materialized view with both stale and fresh data

System privileges:

You must grant several system privileges to all users who will be using the materialized views. In many cases, the Oracle DBA will encapsulate these grant statements into a single role and grant the role to the end users:

grant query rewrite to scott;
grant create materialized view to scott;
alter session set query_rewrite_enabled = true;

Page: 1 2 3

 More Oracle Articles, Database Articles and DBA Tips
   Database Security: Step by step guideline
   Beware of DISTINCT Clause, Important Concerns!!
   Oracle 11g Enhanced Optimizer Statistics Maintenance!!
   The power of Oracle Diagnostic Tools!
   Avoiding Rollback Generation in Bulk Delete!!


FreeMegaZone Jobs

 

 
HOME      ABOUT US      SUPPORT      SITE MAP      PRIVACY POLICY      TERMS OF USE      SUBMIT CONTENT      ADVERTISE
Copyright © 2007 - 2010 Oriole Intellect Inc. All rights reserved.

The name Oracle is a trademark of Oracle Corporation. Any other names used on this website may be trademarks of their respective owners