Home

Tuesday, 14 October 2014

Rollback Segment Management

Rollback segments :

ROllback segments stores undo information and are used for following purpose

1.To undo the privious command
2.For read consistency and
3.For crash recovery

Each rollment segment consists of:

->consistes of several rollback entries from multiple transaction.
->stores block information such as files and blocked,as well as data as it existed before being modified
->must be created under special circumstances and brought online before being used.
->may increase due to large transacton
->will automatically shrink to optimal if extented
->transaction can be assaigned automatically or explicity

-->Rollback segment maintains a table for every transaction,which is identified by SMON during recovery.when
you create database ,system tablespace and system rollback segment is created .you cannot drop this segment .depending on the number of
transaction you have to decide how amny rollback segments are needed. they are 2 types of rollback segments
   1.PUBLIC and
   2.PRIVATE

sys>>select segment_type,segment_name from dba_segments;

   
If we want to create a new rollback segment RBS1 in tablespace rbs_demo

sys>>create rollback segment rbs1 tablespace rbs_demo storage (initial 40k next 40k OPTIMAL 120k MINEXTENDS 2 maxextends 10);

->If you want to make it ONLINE or want to change storage parameters you have to use alter command as follows :

note :rollback segment cannot be created in a locally managed tablespaces.to crete rollback segment the tablespace
must be dictionary-managed tablespace

To convert a locally manged tablespace to dictionary managed

sys>>EXEC DBMS_SPACE_ADMIN.TABLESPACE_MIGRATE_FROM_LOCAL ('RESDATA');


To change the storage parameters:

sys>>alter rollback segment rbs1 storage (maxextends 15);

To make it Online :
sys>>alter rollback segment rbs1(ONLINE/OFFLINE);

To bring rollback segments online automatically,set rollback_segments parameter in init<ORACLE_SID>,ora parameter file

to explcity assaign a rollback segment to a transaction

sys>>set transaction use rollback segment rbs1;


sys>>alter rollback segment rbs1 SHINK to 100k;


Droping a rollback segment
sys>>alter rollback segment rbs1 offline;
sys>>drop rollback segment rbs1


No comments:

Post a Comment