Oracle Database - (Logical) Extent (Unit of Storage)

Card Puncher Data Processing

About

An extent is a group of contiguous data blocks.

An extent can contain data from only one data file.

An extent is a logical unit of database storage space allocation made up of a number of (contiguous|ordered) data blocks.

One or more extents make up a segment.

For instance, a table table is made up of one segment (if not partitioned) and each extent is made up of oracle blocks. With a common block size of 8k, and a table of 80k of data, you may have a table with 10 extents.

Oracle Segment Extent Data Block

Relation with Data File and Segment

A data file is an ordered collection of extend (extend 1, 2, 3, …) whereas segment are an unordered collections of extends.

dba_extents

dba_extents shows the extents for a segment.

Extent_id is the extent number in the segment. Beware that one extent id may have several segments.

Unique key of dba_extends:

  • owner (segment unique key),
  • segment_name (segment unique key),
  • partition_name (segment unique key),
  • segment_type (segment unique key),
  • extent_id
SELECT 
    owner, 
    segment_name, 
    partition_name, 
    segment_type, 
    extent_id, 
    COUNT(*)
FROM dba_extents
GROUP BY owner, segment_name, partition_name, segment_type, extent_id
HAVING COUNT(*) > 1;
no rows selected

If a datafile (or entire tablespace) is offline in a locally managed tablespace, you will not see any extent information. If an object has extents in an online file of the tablespace, you will see extent information about the offline datafile. However, if the object is entirely in the offline file, a query of this view will not return any records.





Discover More
Oracle Segment Extent Data Block
Oracle Database - (Fragmented) (Unused|Free) space (Reclaim|Shrink|resize)

Used and free space. A data file contains ordered extents (by block Id). One segments is made up of one of several extents (not ordered, contiguous). Over time, updates and deletes on objects within...
Oracle Segment Extent Data Block
Oracle Database - (Logical) Segment (Database Object Storage)

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...
Card Puncher Data Processing
Oracle Database - Data Files

Every Oracle database has one or more physical datafiles (OS File), which contain all the database data. The data of logical database structures, such as tables and indexes, is physically stored in the...
Card Puncher Data Processing
Oracle Database - High Water Mark (HWM) - boundary between used and unused space

The High water mark is the boundary between used and unused space: for a data file. See or for a segment You can think at the high-water mark (HWM) as the rightmost block that ever contained data...
Card Puncher Data Processing
Oracle Database - Logical Structure

The physical structures of the database contain logical structures: data blocks, extents, segments. tablespaces, and schema objects, Because the physical and logical structures are separate,...
Card Puncher Data Processing
Oracle Database - TableSpace

A tablespace is a logical data structure which is physically represented by one or more datafiles physically. From a analysis point of view, a tablespace is a group of one or more: physic datafile....



Share this page:
Follow us:
Task Runner