Oracle Database - (Logical) Segment (Database Object Storage)
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.
Articles Related
Type
Data Structure (Segment Type)
- CACHE
- CLUSTER
- DEFERRED ROLLBACK
- 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)
- ROLLBACK
- SPACE HEADER
- TABLE (A table content)
- TABLE PARTITION (A table partition content)
- TABLE SUBPARTITION (A table sub-partition content)
- TEMPORARY
- TYPE2 UNDO
- UNDEFINED
Management
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.