SEGMENTS, EXTENTS & BLOCKS. Flashcards
SEGMENTS
Exists within a TABLE SPACE.
They are made up of collection of EXTENTS.
SEGMENT is a set of ONE or more EXTENTS that contain all the Data for a specific type of LOGICAL STORAGE STRUCTURE within a TABLE SPACE.
A logical unit of storage space of an Oracle Database.
It contains at least one Data_file made of blocks.
EXTENTS
These are collection of Data Blocks.
or
Collection of Data Blocks makes an EXTENT.
An EXTENT is a set of contiguous Database Blocks within a Data_File.
EXTENTS are allocated when:
The SEGMENT is CREATED (Initial Extent)
The SEGMENT grows (next Extent)
The TABLE is ALTERED to allocate EXTENTS.
EXTENTS are DE-ALLOCATED when:
The SEGMENT is DROPPED and TRUNCATED.
The SEGMENT is larger than optimal and contains FREE EXTENTS.( for ROLLBACK SEGMENTS ONLY).
Each SEGMENT is created with at least ONE EXTENT
(initial EXTENT).
ORACLE DATA BLOCKS
These are mapped to Disk Blocks. i.e O/S Blocks.
Segments, Extents, Oracle Data Blocks & O/S Blocks
[ O/S Blocks] make up an [Oracle Data Block.]
[ Oracle Data Blocks] make up an [Extent]
[Multiple Extents] make up a [Segment]
NB: The Oracle Data Block is made of many O/S blocks.
TYPES OF SEGMENTS
- DATA SEGMENT:
A collection of EXTENTS that holds all of the Data for a TABLE or a CLUSTER ( named group of TABLES).
- INDEX SEGMENT:
A collection of EXTENTS that hold all INDEX Data. - UNDO(ROLLBACK) SEGMENT:
A collection of EXTENTS that holds ROLLBACK Data.
Used for –rollback, read consistency,recovery and flashback.
- TEMPORARY SEGMENTS:
A collection of EXTENTS that holds Data belonging to TEMPORAL TABLES created during a SORT operation.
- BOOTSTRAP SEGMENT:
An EXTENT that contains DICTIONARY definitions for DICTIONARY TABLES to be loaded when the Database is OPENED.