Skip to Main Content
  • Questions
  • How is undo data retrieved for the purpose of a Flashback Query?

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Carlos.

Asked: July 28, 2017 - 9:36 am UTC

Last updated: July 30, 2017 - 9:56 am UTC

Version: 12

Viewed 1000+ times

You Asked

Hello Tom,

Looking at a flashback version query, it is obvious that all changes to a row are kept in the undo, not just the latest one.

My understanding is that the address of the undo corresponding to a specific row is stored in the header of the data block.

So my question is: do we keep a list of addresses to all the undo corresponding to a specific row in the header, or does Oracle perform a scan through all the undo segment to find all the corresponding undo data for the Flashback version query?

Thanks in advance
Carlos

PS: I do have you book, but after reading it, I still have this doubt.




and Connor said...

Think of it more like a game of "chinese whispers" - we only need information about the "last change", because if we can undo a block to that scn, then *that* block will now have the details for the change before that.

Let's say I have block with:

SALARY=1000, UNDO ADDRESS=A

So I go to undo address "A", and find the undo information to be: "Change SAL to 900, undo address to B". I apply that so now my block is:

SALARY=900, UNDO ADDRESS=B

So I go to undo address "B", and so on...

Hope this helps.


Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Carlos Silva, July 30, 2017 - 11:45 am UTC

Thanks a lot! It is perfectly clear now.

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.