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

Thread: rollback

  1. #1
    Join Date
    Aug 2000
    Posts
    163
    I thought rollback segments only record DML statements. Someone made a statement that rollback segment may contain index creation statements as well as DML statements. Please help me to understand it.
    Thank you.

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Actually neither DML nor DDL (or DCL or ...) statements are recorded in rollback segments. What is recorded in RB are *changes to database blocks*, made by DML statements.

    So RBs do not contain index creation statements (and they dont contain table creation statements either). But what they do contain related to indexes are changes made to index blocks that are triggered by changes in the underlying table rows.

    So if you have a table with bunch of indexes and you perform a large transaction on on it (INSERT UPDATE, DELETE) you'll generated a lot more rollback entries as if there were no indexes on a table.

    HTH,
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    [url]http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76965/c02block.htm#8401[/url]

    Jmodic,
    You mean here in documentation DML means just mere block changes and nothing else...Even this is TRUE with DDL ?

    [Edited by sreddy on 03-04-2001 at 07:14 AM]
    Reddy,Sam

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    sreddy,

    I'm not sure I understand your question, please explain in more detail.

    Anyway, DML statements change the contents of segments (tables, indexes, clusters) and the changes of those changed blocks are recorder in rollback entries. As a matter of fact, RB segments do store block changes, but block contents before the changes took place.

    DDL statements (generaly) do not change user data blocks, they change only the contents of data dictionary (true, the contents of data dictionary is also recorded in database blocks, but those blocks are managed by the RDBMS and are treated differently as far as rollback is concerned). So for example, if you drop a table, oracle records this only in data dictionary and does not even touch the data blocks of this table, so there is nothing to put in RB. And hence you can't rollback the DROP TABLE DDL.

    Sometimes DDL is not recorded in dictionary, as is the case with TRUNCATE TABLE. In this case Oracle has nothing to record into the dictionary, but to the table segment header (it resets the HWM). Again, "true data" blocks (header block is not "true data" block as it does not hold true table data) are not touched by this operation, so there is nothing to record in RB. And again, that's why you can't rollback TRUNCATE.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    I got you. Thanks.
    Reddy,Sam

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