Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I modify the materialized view log table to include fields from the amster table

Posted on 2009-07-08
8
Medium Priority
?
577 Views
Last Modified: 2013-12-19
I created a log table for the master table to be used to refresh data on a materialized view. However, I need the table to record information from 2 additional fields in the master table. How would I configure the log file to do this?
0
Comment
Question by:sikyala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 1500 total points
ID: 24804915
The materialized view log is just to record primary key or rowids of the changed rows. It is not required to have any other columns in the mview log.
0
 

Author Comment

by:sikyala
ID: 24805027
I had to change the primary key on the master table based on the new database system developed that will soon be deployed. I had created the materialized views based on the old primary key which the client used to update their indexes. The clients indexes are based on the old primary key. They want to be able to query based on the old primary key which no longer exist in the log table. This is why I am trying to see if the log table can be modified to include the old primary key fields.
0
 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 1500 total points
ID: 24805081
In this case I have never tried what you ask. I have always completely recreated my materialized view logs if I changed the primary key structure. I'm sorry, I am not sure if what you want to do is possible or advisable. Can't you just recreate the remote MVIEWS completely with a refresh of the master?
0
Independent Software Vendors: 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!

 

Author Comment

by:sikyala
ID: 24805351
yes I have done that because the mviews became invalid when I changed the primary key
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24882539
Looking back at the quesiton I may have been in error when I said it is not required to include columns. This is the command I use on my mview logs.

create materialized view log on scott.REP_TEST tablespace data with primary key including new values
/

So there is no column specification.

But it is possible to use the WITH() clause (without using primary key clause) to specify additional columns, such as join columns.

0
 

Author Comment

by:sikyala
ID: 24882604
do you know the syntax for using the with clause?
0
 

Author Comment

by:sikyala
ID: 24882814
thanks it worked.
0

Featured Post

Independent Software Vendors: 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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

721 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