?
Solved

oracle tables replication

Posted on 2014-10-15
5
Medium Priority
?
463 Views
Last Modified: 2014-10-30
Hi,

 I have two tables TABLE1 and TABALE2 which I joined and build a query. Now the data fetched with this query I need to insert or update(if record already existing) into a table TABLE_REP which is in another schema but same database.
 First time I need to load all the data after that for every week I need to load the data into the new table TABLE_REP. For a week data may be appx. 10 million records.  

 One way is we need to write a Stored procedure and schedule for every week after the first full load.

 Can you please suggest is there any other better way?

Can we use Materialized view and schedule it for every week after the first complete refresh? In this way can we track and log any failed records in any log table?

 Also I need to archive the data from the TABLE_REP table for older data into another table and delete from this table. So if I use Materialized view can I achieve this also?

 Like this I have 10 reporting tables for which data needs to be fetched for every table with 2 base tables joining from another schema.

Which option is better out of these two approaches (stored proc and MV)?or Is there any better approach also other than these two options? Request you to suggest.

 Thanks,
0
Comment
Question by:GouthamAnand
[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
  • 2
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
Wasim Akram Shaik earned 2000 total points
ID: 40381798
I was answering this question just 2 hours back (I think), you had deleted it..

Anyways.. I see that you had modified requirement a little bit(archiving from mv table)

however, i don't think MV is good option here, because you said all the operations are on a single database

Populating a materialized view adds load to server.

materialized view logs improve the performance of materialized view  by using refresh concepts(fash,complete etc.,) but, they do increase the work needed to perform DDL on the base table. additional overhead of maintaining mv logs will also occur on the system.

Going for the procedure is a good option in my view that too not on weekly basis but on daily basis based on some date criteria, if done on weekly basis, seeing your transaction volume procedure may not be effective to handle those many records in a one time.

There are other options too Like Oracle Streams and Oracle golden gate , CDC but they do come with a license(cost) which you may not like.
0
 
LVL 16

Expert Comment

by:Wasim Akram Shaik
ID: 40381818
Apart from above, there is one more option you can consider, unload the data from one schema and load in another schema and do the operations what ever you need one the same table without changing their names

you can consider this option too if you cannot afford going for licensed version software..

Unloading and Loading are not database procedural level operations they are done from OS level, so it may be performed on schema level, however as this operation also happens on the same server.

check out the site for more details on loading and unloading the data using oracle query

http://www.oracle-developer.net/display.php?id=325
0
 

Author Closing Comment

by:GouthamAnand
ID: 40381852
Thank you.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40381923
Even though you already accepted an answer to this I have some comments.

First:
Streams replication is free in Enterprise Edition.

If the tables need to be copies of each other, why not a view in schema2 that selects directly from schema1?

I would look at materialized views.

>>Populating a materialized view adds load to server.

So does physically inserting and updating manually.  Same amount of data has to move from pointA to pointB so I'm not sure the manual process is better or worse than a fast refresh MV.

I would experiment with both options and choose the one that is most efficient.  We cannot predict which method will work best on your systems.
0
 

Author Comment

by:GouthamAnand
ID: 40415100
Thank you slightwv.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Suggested Courses

770 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