Solved

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

Posted on 2009-07-08
8
570 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
  • 4
  • 4
8 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 500 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 500 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24882661
0
 

Author Comment

by:sikyala
ID: 24882814
thanks it worked.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

840 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