Space Management   «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.

Physical Storage Structures

One characteristic of an RDBMS is the independence of logical data structures such as tables, views[1], and indexes from physical storage structures. Because physical and logical structures are separate, you can manage physical storage of data without affecting access to logical structures. For example, renaming a database file does not rename the tables stored in it. An Oracle database is a set of files that store Oracle data in persistent disk storage. This section discusses the database files generated when you issue a CREATE DATABASE statement:
  1. Data files and temp files: A data file is a physical file on disk that was created by Oracle Database and contains data structures such as tables and indexes. A temp file is a data file that belongs to a temporary tablespace. The data is written to these files in an Oracle proprietary format that cannot be read by other programs.
  2. Control files: A control file is a root file that tracks the physical components of the database.
  3. Online redo log files: The online redo log is a set of files containing records of changes made to data.

A database instance is a set of memory structures that manage database files. Figure 2-2 shows the relationship between the instance and the files that it manages.
Database Instance and Database Files
Figure 2-2: Database Instance and Database Files
    • Database Instance
    • Memory
    • Disk
    • Data Files
    • Control Files
    • Online Redo Log
  1. Analysis and Relevant Features:
    • Diagram Overview: The image illustrates the relationship between a database instance and various components stored in memory and on disk.
    • Database Instance: Represented at the top, this element resides in memory. It refers to the set of processes and memory structures that interact with the data stored on disk. The database instance manages the execution of SQL, memory caching, and other operations necessary for database management.
    • Memory and Disk Separation: A dotted line separates memory and disk, indicating the distinction between in-memory operations handled by the database instance and data storage components residing on disk.
    • Disk Components:
      • Data Files: Represented as files on disk, these contain the actual data in the database. Data files are essential for data persistence and are used to store all database objects, such as tables and indexes.
      • Control Files: These are crucial files that record the structure of the database. They maintain metadata, including information about the data files, the location of the online redo log files, and the current state of the database.
      • Online Redo Log: These are files that record all changes made to the data. They ensure data integrity and help recover the database to a consistent state in case of a failure. The online redo logs are crucial for data recovery and are constantly updated as transactions occur.

This diagram visually emphasizes the importance of memory and disk components in the overall functioning of a database system.

Storage Concepts in Oracle
Diagram consisting of Tablespace, Extents, Data blocks and Segments
Diagram consisting of Tablespace, Extents, Data blocks and Segments

  1. Data blocks: Data blocks are the smallest level of storage management. They map to operating system blocks.
  2. Extents: Extents are composed of contiguous blocks on a disk.
  3. Segments: A segment is typically associated with a single table or index. A segment can contain one or more extents.
  4. Tablespace: The tablespace is at the top of the storage hierarchy. A tablespace is directly connected with one or more datafiles, which are managed by the underlying operating system.

The next lesson is about data blocks.
[1] view: A database object that enables you to define the columns and rows that a specific user can see. A view can also serve as a tool for enforcing security within your database.

SEMrush Software 2SEMrush Software Banner 2