Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question.

Asked: March 31, 2017 - 1:11 am UTC

Last updated: September 05, 2017 - 2:09 pm UTC

Version: 11G

Viewed 10K+ times! This question is

You Asked

Hi,

I would like to know about two situations:

1)my base table is not partitioned and i have a materialized view on the same. Is it possible to partition the materialized view.
If yes kindly provide steps for the same.

2)I have a table which has 6 hash partitions based on a key column.Now i want to create a materialized view on the same , which i also want to make hash partitioned.Kindly let me know about the steps how the same can be achieved.

Regards
Shibaji

Thanks & Regards

and Connor said...

(1) yes and (2) yes. The source table does not have an impact on your decision for partitioning on the mview, eg

SQL> create table t as select * from dba_objects;

Table created.

SQL>
SQL> create materialized view MV
  2   partition by hash ( object_id )
  3   partitions 6
  4   refresh complete on demand
  5   as select * from t;

Materialized view created.


Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

MView on a Partitioned table

Debasish Dutta, September 05, 2017 - 7:17 am UTC

Hi Tom,

Based on your answer, one query popped up in my mind. Can you please help me.

What if I want to create a non-partitioned matview on a partitioned table. If I drop any partition of the table, would it invalidate the matview and the refresh will fail? If yes, how can I overcome it so that the matview is not invalidated even if I drop any particular partition.

More to Explore

VLDB

If you are new to partitioning, check out Connor McDonald's introduction series here.

VLDB

Documentation set on VLDB and Partitioning.