DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: redo and undo

  1. #1
    Join Date
    Nov 2006
    Posts
    1

    Exclamation redo and undo

    gfgffdf when we execute any SQL or PL-sql script/statement it creates an entry in REDO log buffer and UNDO Sengment. Undo is used for storing changed data ie. data changed during transaction and used for rollback pupose... thn wh is the use of REDO entry ????

  2. #2
    Join Date
    May 2005
    Location
    Boracay
    Posts
    681
    ambot sa imo...gadangas lang na imong agtang just a wild guess,
    I think they just serve for the same purpose hunnie...redo is used
    to store the "after" image of the updated data and undo
    is used to store the "before" image of the data.
    Behind The Success And Failure Of A Man Is A Woman

  3. #3
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    well they are definitely not for the same purpose

    redo contains all the changes which can be used in case of a database crash, undo is used to privde a consistent view of the data and for rollback

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    redo is absolutely everything, if you have archive log then it lasts forever as long as you dont delete the archive logs of curse

    undo mostly DML changes, it only lasts during a transaction (mostly again)

  5. #5
    Join Date
    Nov 2006
    Location
    Sofia
    Posts
    630
    Redo is ReDo - contains a description of all the changes in the database. Looks like "In file A block B field C change value from 10 to 20" That allows you to REDO that change in case of media failure. Then you return files from backup AND REDO all the changes made after the moment of backup so you do not loose data. The REDO is saved in redo log files and archived redo log files OUT OF THE DATAFILES
    UNDO is UnDo - contains the BEFORE immages of your data, and is generally kept until the end of the transaction. It is used to UNDO your changes in case of transaction failure or user rollback. It is also used for read consistent view of the data i.e. when you have changed the data, but still not commited, the other users sees the OLD STATE of the data, not the changed. That's taken from the UNDO.
    The UNDO is saved in the segments (like tables) and these segments by themselves are covered by the REDO generation.
    You'll understand clearly the difference when become more experienced :-)

  6. #6
    Join Date
    May 2005
    Location
    Boracay
    Posts
    681
    wow i'm impressed..very well explained...at least my wild guess is similar
    Behind The Success And Failure Of A Man Is A Woman

  7. #7
    Join Date
    Nov 2006
    Location
    Sofia
    Posts
    630
    I often teach Oracle courses :-)
    Ipersonally realized clearly the difference in my 2th year as DBA :-)

  8. #8
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Quote Originally Posted by Bore
    Ipersonally realized clearly the difference in my 2th year as DBA :-)

    You must be a brilliant student then...
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width