Query on Redo and Undo Basic concept [message #482975] |
Wed, 17 November 2010 05:42 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
OraKaran
Messages: 183 Registered: March 2008 Location: United Kingdom
|
Senior Member |
|
|
Hello
Sorry if I haven't posted this query in the correct forum
Please help me understanding a redo/undo concept
please refer following data
create table t(n number);
insert into t values(10);
commit;
now I update as following
As per my understanding the before image i.e. n=10 is stored in undo (to be used for rollback, transcation recovery and even in instance recover but not in media recovery) and after image n=20 is stored in redo (to be used for various recovery purposes including media recovery in case of consistent backup)
So it is redo logs for rolling forward and undo for rolling back making transaction, db consistent
If my above understanding is true then what is meant by the term 'redo required for undo'?
Also
if there are 2 database db1 and db2 connected using database link where we are populating t1 table in db1 using t2 table in db2 using db link where redo and undo will be updated db1 or db2?
Regards,
OraKaran
|
|
|
Re: Query on Redo and Undo Basic concept [message #482976 is a reply to message #482975] |
Wed, 17 November 2010 05:52 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
For the 2nd point the answer would have to be - the db that's getting it's data modified. How could it be anything else?
Think of a db link as just another data source, using one doesn't change the mechanics of undo and redo.
For the 1st others can explain these concepts better than me.
|
|
|
|
|
|
Re: Query on Redo and Undo Basic concept [message #482982 is a reply to message #482980] |
Wed, 17 November 2010 06:47 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
OraKaran
Messages: 183 Registered: March 2008 Location: United Kingdom
|
Senior Member |
|
|
Hello Experts
Thanks for your answers
While reading the anwsers I realized I must confirm my understanding of your answers and that of my question are matching!
I am extremly sorrying for not putting it in SQL way
Here is what I understand from your answers
1)
following describes what I meant
insert into db1 select * from db2@dblink.world;
for this I undrstand from advise is that
redo and undo generation would be for db1 only as db2 is referred as read only in above case
2)
In following case where remote table is updated, again redo and undo will be generated on db1 ONLY
Is that Correct?
insert into db1@dblink.world select * from db2;
3)
Since undo is protected by redo
can we say undo and redo generated by transcations will never be same and redo will be more as compared to undo, which will be closer to the amount of data modified?
Regards,
OraKaran
|
|
|
Re: Query on Redo and Undo Basic concept [message #482983 is a reply to message #482982] |
Wed, 17 November 2010 06:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68676 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
1) OK
2) Almost, it depends on other statements of your transaction. In short, some information are needed in db2 (local database) to manage the distributed transaction. So in this case, there are data in redo of both databases, but only data in undo of db1.
3) Data in redo and undo are in different formats you cannot compare their size (if this is what you meant).
Regards
Michel
[Edit: typo]
[Updated on: Wed, 17 November 2010 08:26] Report message to a moderator
|
|
|
|
|
|