Oracle Database - (Logical) Segment (Database Object Storage)

1 - About

A segment is a logical storage structure that contains data structure (segment type) of database objects.

For example:

  • each table's data is stored in its own data segment,
  • while each index's data is stored in its own index segment.

One segment name is one object but one object may have several segments records.

A segment is uniquely defined with the following columns:

  • the owner
  • the segment name
  • the partition name (A table may have several partitions)
  • the segment type (A package has a body and a definition)

A segment is an set (unordered) of extents. A segment and all its extents are stored in one tablespace.

Oracle Database allocates space for segments in units of one extent. When the existing extents of a segment are full, Oracle Database allocates another extent for that segment. Because extents are allocated as needed, the extents of a segment may or may not be contiguous on disk.

Within a tablespace, a segment can include extents from more than one file; that is, the segment can span datafiles.

3 - Type

Data Structure (Segment Type)

  • INDEX (An index)
  • INDEX PARTITION (An index partitioned)
  • INDEX SUBPARTITION (An index subpartition)
  • LOBINDEX (Index of LOB column)
  • LOBSEGMENT (Content of a LOB column)
  • LOB PARTITION (Content of lob column in a partitioned table)
  • LOB SUBPARTITION (Content of lob column in a subpartition)
  • NESTED TABLE (A nested-table content)
  • TABLE (A table content)
  • TABLE PARTITION (A table partition content)
  • TABLE SUBPARTITION (A table sub-partition content)

4 - Management

4.1 - Action

As a segment is an object, you must refer to the object (alter, create,…) statement to modify them.

Example: if you want to suppress a lobindex segment, you need to suppress the lob column.

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap