Please send your Questions & Answers or Feedback to "dvmadhavreddy@javabook.org"

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

Undo Management

Prior to 9i, undo segments are called "rollback segments".

As a DBA, we need to create the rollback segments manually by specifying the following init.ora parameters :
                1.undo_management = auto
                2.rollback_segments = rbs,rbs2,rbs3.....

Once we create a rollback segment, by default it is offline and we need to make it online manually.
If the parameter rollback_segments is set in the init.ora, all rollback segments will come online during the instance startup.

With respect to rollback segments there are more chances of getting out of space errors and snap shot too old errors.

As a DBA, we need to continuously monitor the growth of the rollback segments.
We can also allocate a specific transaction to a specific sengment.

                SQL> set transaction use rollback segment rbs1;
                SQL> create rollback segment rbs1
                                tablespace rbs_ts
                                storage(initial 100k
                                                next 100k
                                                minextent 2
                                                optimal 200k
                                                maxextents 6);


The minimum number of extents that need to be allocated is 2 because it follows head and tail mechanism.
Optimal represents the size in bytes to what extent a rollback segment has to shrink once the transaction is completed.
More than one transaction can groq in rollback segments or undo segments.
Oracle deallocates the extents of a rollback segments once the size of the rbs exceeds the optimal parameter value or if there are contiguous free extents.

The header or pointers of a rollback segment moves to the next extent if it is free or inactive.

Since there are somany disadvantages with rollback segments oracle has introduced the concept of "undo management".

In 9i, oracle has introduced automatic undo management.
Once we create undo tablespace by default oracle creates 10 undo segments with the naming convention "syssmu$n".
For every DML operation we requrire undo segments.
There are 2 types of undo segments:
                1.system undo segments
                2.non system undo segments

All undo segments that are created in the undo tablespace are non system undo segments. These undo segments will be used by the business users to perform DML operations.

Allocation of transactions to undo segments and deallocation of transactions from undo segments will be taken care by oracle itself.

Note : All DDL statements are auto commit.

Once we create a database, by default one undo segment will be created in system.dbf and this will be used by the system itself.
The purpose of undo segments is :
                1.transaction rollback
                2.transaction recovery
                3.instance recovery
                4.read consistancy
In order to use automatic undo management, we need to set the following init.ora parameters :
                1.undo_management = auto
                2.undo_tablespace = undo_ts
                3.undo_retension = <default value 900>
                                900 seconds.

"undo_retension" represents how long the commited data has to be retrieved in the undo. As per the parameter value, oracle tries to retain the data in the undo but it is not guaranteed.
If there is no space for the other incoming transactional data, oracle overrides.
Related Posts Plugin for WordPress, Blogger...

Flag Counter