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,
extents contain data blocks,
segments are made up of extents, and
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.
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.
Characteristics of Oracle Tablespaces
The tablespace, the highest level of physical organization in an Oracle database, is the interface between
the physical storage of the database and
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:
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.
Control files: A control file is a root file that tracks the physical components of the database.
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.
Storage Concepts in Oracle
Data blocks: Data blocks are the smallest level of storage management. They map to operating system blocks.
Extents: Extents are composed of contiguous blocks on a disk.
Segments: A segment is typically associated with a single table or index. A segment can contain one or more extents.
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.