Within Oracle, the space used to store data is controlled by the use of logical structures. These structures consist of the following:
- Data blocks--A block is the smallest unit of storage in an Oracle database. The database block contains header information concerning the block itself as well as the data.
- Extents--Extents consist of data blocks.
- Segments--A segment is a set of extents used to store a particular type of data.
Segments, extents, and data blocks.
Segments:
An Oracle database can use four types of segments:
- Data segment--Stores user data within the database.
- Index segment--Stores indexes.
- Rollback segment--Stores rollback information used when data must be rolled back.
- Temporary segment--Created when a SQL statement needs a temporary work area; these segments are destroyed when the SQL statement is finished. These segments are used during various database operations, such as sorts.
Extents:
Extents are the building blocks of segments; in turn, they consist of data blocks. An extent is used to minimize the amount of wasted (empty) storage. As more and more data is entered into tablespaces in your database, the extents used to store that data can grow or shrink as necessary. In this manner, many tablespaces can share the same storage space without preallocating the divisions between those tablespaces.
At tablespace-creation time, you can specify the minimum number of extents to allocate as well as the number of extents to add at a time when that allocation has been used. This arrangement gives you efficient control over the space used in your database.
Data Blocks:
Data blocks are the smallest pieces of an Oracle database; they are physically stored on disk. Although the data block in most systems is 2KB (2,048 bytes), you can change this size for efficiency depending on your application or operating system.
No comments:
Post a Comment