Managing DB Objects   «Prev  Next»
Lesson 2Oracle Storage Management Concepts
ObjectiveUnderstand storage management at a high level.

Oracle Storage Management and Table Space Concepts

Oracle storage management is built on four basic entities: 1) data blocks, 2) extents, 3) segments, and 4) tablespaces.
These entities have a hierarchical relationship,
  1. extents contain data blocks,
  2. segments are made up of extents, and
  3. tablespaces are made up of segments.

Overview of Data Blocks

Oracle Database manages the logical storage space in the data files of a database in a unit called a data block, also called an Oracle block or page. A data block is the minimum unit of database I/O.

Data Blocks and Operating System Blocks

At the physical level, database data is stored in disk files made up of operating system blocks. An operating system block is the minimum unit of data that the operating system can read or write. In contrast, an Oracle block is a logical storage structure whose size and structure are not known to the operating system. Figure 1 shows that operating system blocks may differ in size from data blocks. The database requests data in multiples of data blocks, not operating system blocks.

Data Blocks and Operating System Blocks
Figure 1: Data Blocks and Operating System Blocks

Schema Object Storage

Some schema objects store data in logical storage structures called segments. For example, a nonpartitioned heap-organized table or an index creates a segment. Other schema objects, such as views and sequences, consist of metadata only.
This section describes only schema objects that have segments. Oracle Database stores a schema object logically within a tablespace.
There is no relationship between schemas and tablespaces: a tablespace can contain objects from different schemas, and the objects for a schema can be contained in different tablespaces. The data of each object is physically contained in one or more data files. Figure 2 shows a possible configuration of table and index segments, tablespaces, and data files. The data segment for one table spans two data files, which are both part of the same tablespace. A segment cannot span multiple tablespaces.

Segments, Tablespaces, and Datafiles
Figure 2: Segments, Tablespaces, and Datafiles

Characteristics of Oracle Tablespaces

The tablespace, the highest level of physical organization in an Oracle database, is the interface between
  1. the physical storage of the database and
  2. the logical structures within the database.
The tables, indexes, and other objects within a database are assigned to a tablespace. The tablespace is also the interface to the physical files managed by the underlying operating system. Each tablespace is associated with one or more physical files.
A tablespace is generally the smallest unit of physical storage that can be addressed by standard Oracle operations, such as backup and recovery.
This does not mean that you can ignore the underlying levels of space management. Because each of these levels of physical organization is dependent on the other, the characteristics of each level of storage affect the higher levels.
Legacy Oracle Storage Concepts
The next lesson is about data blocks.