Whenever a new transaction needs undo space:
- First , oracle tries to find a undo segment which has no active transaction and allocate the extent within the undo segment.
- If no such undo segment found then oracle tries to make online of and off-line undo segment and use it.
- If no such off-line undo segment found then create a new undo segment and use it.
- If there is no sufficient space to create a new undo segment then it try to reuse an expired extent from the existing undo segment.
Whenever a running transaction needs more undo space:
- If current extent has more free blocks? If it has then allocate the next free block within the extent.
- If current extent does not have free blocks then check the next extent within the segment. If the next extent is expired then wrap the next extent and allocate the first block of the next extent.
- If the next extent is not expired then get space from UNDO tablespace.If a free extent is available then allocate it to the undo segment and return the first block in the new extent.
- If there is no free space available then take space from offline undo segment. Deallocate the extent from the offline undo segment and add it to the current undo segment. Return the first free block of the extent.
- If there is no offline undo segment then deallocate the extent from the online undo segment and add it to the current undo segment. Return the first free block of the extent.
- If it fails then extend the datafile of the undo tablespace.If the file can be extended then add an extent to the current undo segment then return the block.
- If the extend datafile fails then try to reuse extents from its own undo segments. If it is not busy then warp into the next extent.
- If reuse extents from its own undo segment fails i.e they contain uncommitted transaction then take unexpired extents from it's own offline undo segments.
- If it fails then take unexpired extents from it's own online undo segments.
0 comments:
Post a Comment