Forum Stats

  • 3,741,941 Users
  • 2,248,505 Discussions
  • 7,862,083 Comments

Discussions

In Memory Undo

676285
676285 Member Posts: 6
edited Dec 23, 2010 7:44AM in General Database Discussions
Hi All.
Does IMU generate redo for ALL data changed?

I guess that in case of the IMU transaction undo segment header is modified at the begining ( for ITL entries) and so that would need redo.
But since the actual IMU is in the shared pool, no redo is generated , and when an IMU flush happens the proper undo block is updated with the "collapsed" data.
I went through two quality materials on this subject
http://www.oracle.com/education/america_eblasts/fy09/q1/craig_shallahamer_all_about_oracle_s_in_memory_undo.pdf
and
http://www.teamycc.com/RMOUG_2008_Conference/PDF/Haisley.pdf

Both seem to suggest that redo is generated, but the wordings in the second paper suggests that ALL redo for the undo "blocks" are recorded in the redo stream, whereas the first paper suggests that redo is generated only for the "collapsed" values.
I am doubting whether my confusion arises out of the "throwaway" undo and "normal" IMU operations.
Any assistance would be welcome and thanks in advance!!

Edited by: indhar on Dec 13, 2009 6:39 PM

Edited by: indhar on Dec 13, 2009 6:40 PM
«1

Answers

  • damorgan
    damorgan Member Posts: 14,464 Bronze Crown
    redo only captures information for committed transactions.
  • damorgan
    damorgan Member Posts: 14,464 Bronze Crown
    If I read the links you posted correctly using this feature requires setting an underscore initialization parameter.

    And Oracle's official statement about changing these without authorization could not be much clearer.

    So where's the issue?

    If Oracle tells you to change it ask them. If they didn't leave it alone.
  • Pavan Kumar
    Pavan Kumar Member Posts: 11,903 Gold Crown
    Hi,
    Both seem to suggest that redo is generated, but the wordings in the second paper suggests that ALL redo for the undo "blocks" are recorded in the redo stream, whereas the first paper suggests that redo is generated only for the "collapsed" values.
    I am doubting whether my confusion arises out of the "throwaway" undo and "normal" IMU operations.
    Any assistance would be welcome and thanks in advance!!
    AFAIK, Undo will not be recorded in Redo until the transactions are committed. See Advantage of IMU, its removing of burden of Maintaining the Chain of Undo buffer Management Separately in memory, instead of that existing IMU is maintaing with help of pointer and updating the ITL with the memory. So it will be advantage when compared to regular flow

    - Pavan Kumar N
    Oracle 9i/10g - OCP
    http://oracleinternals.blogspot.com/
  • 676285
    676285 Member Posts: 6
    Thanks for the replies Daniel.
    My objective was to have a clearer understanding of the implementation rather than implementing it rightaway.
  • redo only captures information for committed transactions.
    No..but it capture all changes whether they are committed or not committed
  • 676285
    676285 Member Posts: 6
    Yes Pavan, I do appreciate the advantages of IMU.
    I got my doubts on those very particular words and since there were two types of IMUs discussed!!
    So, I guess that from Mr.Haisley's paper, I should take it to mean as
    " All the physical undo blocks, that would actually be written into during the commit/IMU flush, would be in the redo stream"
  • 676285
    676285 Member Posts: 6
    I think Daniel was talking in the IMU context and not in the general context, that you are (hopefully) alluding to... :)
  • Maran Viswarayar
    Maran Viswarayar Member Posts: 6,130
    edited Dec 13, 2009 11:53PM
    AFAIK, Undo will not be recorded in Redo until the transactions are committed.
    It records every thing in the Redolog and when the transaction is commited it creates another redo record to mark the trnsaction as committed...

    Edited by: Maran Viswarayar on Dec 14, 2009 12:53 PM
  • Daniel/Pavan..

    I am sorry guys..i didnt read them properly...
  • Aman....
    Aman.... Member Posts: 22,913 Gold Crown
    AFAIK , the redo is generated for all teh data. For IMU, there is a private region available in the shared pol thatmaintains it.

    Just for the sake of reference, I too did talk about it. I would welcome you to read and if possible, comment as well correct too.
    http://blog.aristadba.com/?p=17

    HTH
    Aman....
  • damorgan
    damorgan Member Posts: 14,464 Bronze Crown
    Not in Oracle. You are confusing Oracle with SQL Server or some other product.
  • Maran Viswarayar
    Maran Viswarayar Member Posts: 6,130
    edited Dec 14, 2009 3:10AM
    Not in Oracle
    What do you mean by this?

    You mean to say redo has only commited transactions?

    Edited by: Maran Viswarayar on Dec 14, 2009 4:09 PM
  • damorgan
    damorgan Member Posts: 14,464 Bronze Crown
    No I mean in any context no matter how you define it.

    In Oracle the redo stream ONLY contains committed transactions.

    We do not use Streams or Data Guard to replicate uncommitted transactions.
    We do not use Redo Log Files and Archived Redo Log Files to recover uncommitted transactions.
    Not in Oracle.

    Start reading here:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/storage.htm#ADMQS12049

    Continue here:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/transact.htm#CNCPT1119

    How much redo do you think you generate if you update 1,000,000 rows and follow it with ROLLBACK rather than COMMIT?
  • Girish Sharma
    Girish Sharma Member Posts: 4,980 Bronze Crown
    Hi,

    http://www.oracle.com/education/america_eblasts/fy09/q1/craig_shallahamer_all_about_oracle_s_in_memory_undo.pdf

    And one of great reply by Tanel Podder at below link:
    http://www.freelists.org/post/oracle-l/First-17-updated-records-disappeared-from-REDOLOG-files,2

    HTH
    Girish Sharma
  • mbobak
    mbobak Member Posts: 1,342 Gold Badge
    Hi Dan,
    damorgan wrote:
    No I mean in any context no matter how you define it.

    In Oracle the redo stream ONLY contains committed transactions.

    We do not use Streams or Data Guard to replicate uncommitted transactions.
    We do not use Redo Log Files and Archived Redo Log Files to recover uncommitted transactions.
    Not in Oracle.
    Sorry, Dan, but the above is just plain wrong. Uncommitted data can and will get written to the online redo log files. If that uncommitted data is later rolled back, Oracle will rollback the changes by referring to undo.

    In the event of an instance crash, during instance recovery, Oracle will read the file headers, determine which files need to be recovered to what SCN, then read the redo, apply all changes in redo, up to the point in time of the instance crash, then read undo headers, find all uncommitted transactions, and roll them back.

    Uncommitted data can and will be written to redo log files, but, it's ok. In the future, that uncommitted data will either get committed or get rolled back, and the state of the database will be preserved.

    For an Oracle Documentation reference, see here:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/onlineredo001.htm#i1006163
    Scroll down to "Redo Log Contents", and see the fourth paragraph.
    Start reading here:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/storage.htm#ADMQS12049

    Continue here:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/transact.htm#CNCPT1119
    I checked those links briefly, skimmed over them, and I didn't see anything that explicitly supports your statement. While it's certainly true that committed data must be written to redo, (in fact, the commit isn't complete till LGWR signals the user's server process that the redo write is complete), there's nothing that says uncommitted data will not be written to redo. It can and will happen.
    How much redo do you think you generate if you update 1,000,000 rows and follow it with ROLLBACK rather than COMMIT?
    In the event of an update, I'd expect at least as much redo generated for rollback as commit. In the event of an insert, I'd expect rollback to be less than insert, and for a delete, I'd expect rollback to be more than insert.

    -Mark
  • damorgan
    damorgan Member Posts: 14,464 Bronze Crown
    I stand corrected. I forgot about changes to undo segments.
  • Kamran Agayev A.
    Kamran Agayev A. Member Posts: 5,520 Bronze Crown
    Agree with Bobak

    I've asked this question from Tom Kyte, please read his answer below:

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1670195800346464273

    - - - - - - - - - - - - - - - - - - - - -
    [Kamran Agayev A. |http://kamranagayev.wordpress.com] (OCP 9i/10g)
    Author of "Oracle Backup & Recovery: Expert secrets for using RMAN and Data Pump"
    http://www.rampant-books.com/book_1002_rman_backup_recovery.htm
  • In Oracle the redo stream ONLY contains committed transactions.
    It cant be

    Assume i update a millions of records and the log buffer is 5MB ...and the update takes 15 minutes..

    Do you think nothing will be written in the redolg...

    The logwrites writes the contents of redolog buffer every 3 seconds along with another 3 events which triggers the logwriter...

    It writes all the change vectors into the redolog file
  • 695836
    695836 Member Posts: 785
    Why in Oracle its so difficult to retain the basics?
    or Why in Oracle its so easy to forget the basics?
    Earlier I remember in one of the threads i read Sybrand pointed out , when datafile is in begin backup mode,it is not written??
  • Pavan Kumar
    Pavan Kumar Member Posts: 11,903 Gold Crown
    Hi,

    Now, the topic diverts to Fractured blocks and it' concepts.

    - Pavan Kumar N
    Oracle 9i/10g - OCP
    http://oracleinternals.blogspot.com/
  • Kamran Agayev A.
    Kamran Agayev A. Member Posts: 5,520 Bronze Crown
    Earlier I remember in one of the threads i read Sybrand pointed out , when datafile is in begin backup mode,it is not written??
    It's incorrect. They are written. See the following discussion of Tom Kyte
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:271815712711

    - - - - - - - - - - - - - - - - - - - - -
    [Kamran Agayev A. |http://kamranagayev.wordpress.com] (OCP 9i/10g)
    Author of *"Oracle Backup & Recovery: Expert secrets for using RMAN and Data Pump"*
    http://www.rampant-books.com/book_1002_rman_backup_recovery.htm
  • This link will provide all the necessary information

    http://hrivera99.blogspot.com/2008/11/what-happens-during-hot-backup.html
  • 695836
    695836 Member Posts: 785
    I know what happens in begin backup mode.I know the necesary basics.
    Whqat i wanted to say was as damorgan said redo streams contain only committed data.Likewise Sybrand once said, a datafile is not written in backup mode. All these are senior people with far more knowledge than us but they too can forget the basics not only us.So thats why I said ...
  • Anyone can forget anything at anytime...Its just that simple...We are human... :)
  • 695836
    695836 Member Posts: 785
    Nah!! You cannot forget the basics. Its not permissible :)
This discussion has been closed.