Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Fast Refresh in Materialized Views Partitioned

FromHellFeb 8 2007
Hi all.. I've a little problem... let's go into it:
I have two tables:
A dimension table , named D1
A partitioned fact table, named F1
I create two materialized views log in each of 2 tables.
Ok.. Now, I created a Materialized View Partitioned, name MV_F1D1, with incremental refresh for it...
I can create the Materialized View Partitioned with fast refresh, no problem here...
First time Oracle make a Complete refresh, everything ok.. Then I make a
BEGIN
DBMS_SNAPSHOT.REFRESH('MV_F1D1','F');
END;

And everything goes well...

But.. In my fact tables, I load the data with a temporary table, named F1_NP (Fact table no partitionated)
with the data of the current month. Every week I do this:
1) Load the data in F1_NP
2) If the LAST_PARTITION_MM_YYYY not exists in F1, I add the partition to F1...
3) ALTER TABLE F1 EXCHANGE PARTITION LAST_PARTITION_MM_YYYY WITH TABLE F1_NP

And, this is the problem....

After that process, the Log table of F1 is empty..

When i'm trying to fast refresh the mv_F1D1, I got an error
ORA-12097 changes in the master tables during refresh, try refresh:
THis occurs when only I truncate a partition
in the fact table too.

Ok.. My only solution here is to make a complete refresh.. But I have only a new partition. I expected that with the PCT, Oracle let me
do it a fast refresh.

I'm looking for a solution in the web, and I installed the utlxmnv.sql:

1) Before add a partition in F1

truncate table mv_capabilities_table;
exec DBMS_MVIEW.EXPLAIN_MVIEW ( 'MV_F1D1' );
select * from mv_capabilities_table;

PCT Y
REFRESH_COMPLETE Y
REFRESH_FAST Y
REWRITE Y
PCT_TABLE Y F1
PCT_TABLE N D1 2068 Relation is not partitioned.
REFRESH_FAST_AFTER_INSERT Y
REFRESH_FAST_AFTER_ONETAB_DML Y
REFRESH_FAST_AFTER_ANY_DML Y
REFRESH_FAST_PCT Y
REWRITE_FULL_TEXT_MATCH Y
REWRITE_PARTIAL_TEXT_MATCH Y
REWRITE_GENERAL Y
REWRITE_PCT Y
PCT_TABLE_REWRITE Y F1
PCT_TABLE_REWRITE N D1 2068 Relation is not partitioned.

2) After truncate a partition in F1

truncate table mv_capabilities_table;
exec DBMS_MVIEW.EXPLAIN_MVIEW ( 'MV_F1D1');
select * from mv_capabilities_table;

PCT Y
REFRESH_COMPLETE Y
REFRESH_FAST Y
REWRITE Y
PCT_TABLE Y F1
PCT_TABLE N D1 2068 Relation is not partitioned.
REFRESH_FAST_AFTER_INSERT N F1 2077 Mv log is newer than last full refresh
REFRESH_FAST_AFTER_INSERT N F1 2077 Mv log is newer than last full refresh
REFRESH_FAST_AFTER_ONETAB_DML N 2146
REFRESH_FAST_AFTER_ANY_DML N F1 2076
REFRESH_FAST_AFTER_ANY_DML N 2161
REFRESH_FAST_PCT Y
REWRITE_FULL_TEXT_MATCH Y
REWRITE_PARTIAL_TEXT_MATCH Y
REWRITE_GENERAL Y
REWRITE_PCT Y
PCT_TABLE_REWRITE Y F1
PCT_TABLE_REWRITE N D1 2068 Relation is not partitioned.


BEGIN
DBMS_SNAPSHOT.REFRESH('MV_F1D1','F');
END;

ORA-32313: REFRESH FAST of "MV_F1D1" unsupported after PMOPs



any ideas? Can I fast refresh a MV partitioned (composed with a Table Dimension and Fact table)
with PCT when I add data in the Dimension Table/add a partition in a Fact Table Partitioned?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2007
Added on Feb 8 2007
0 comments
465 views