René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

Segments in Oracle

A segment is a container for objects (such as tables, indexes....). A segment consists of extents.

Segment types

There are 11 types of segments in Oracle 10g:
  • table
  • table partition
  • index
  • index partition
  • cluster
  • rollback
  • deferred rollback
  • temporary
  • cache
  • lobsegment
  • lobindex
These types can be grouped into four segment classes:
  • data segments: table and cluster
  • index
  • rollback
  • temporary data
In order to find out the size of the respective segments, use dba_segments (or user_segments, or all_segments).
A segment can either be created so that it can have an unlimited or limited number of extents.
Oracle keeps track of free blocks for each data segment.

Segment Headers

The segment header is stored in the first block of the first extent. It contains:

Temporary segments

The following SQL statements require a temporary segment if they cannot be completed in memory: Actually, most of these statements require a sort.
Temporary segments can be stored in any tablespace. However, it makes more sense to store temporary segments in a temporary tablespace.
SMON frees temporary segments.