To understand how Oracle database store objects in hard drives, we need to realize some key concepts.
Block or Page
The finest granule of space allocation, it represents a continuous area in a physical hard drive.
Extent
one or more blocks used for extending a segment. When specify a extent, the size should be multiple of a block size.
Segment
consisted with one or more blocks for allocating a logical db object. e.g a table or an index will have a segment to storage. a segment can grow in extent.
Data File
A physical file in os file system. It is assigned to a table space.
Table Space
Has one or more data files, used to manage space allocation, e.g. maximum size, because database cannot control file size. There are also other attributes that can be set and managed by DBA in this layer, such as quota for a single user.
Notes
An extent is storage space of continuous of blocks;
An segment stays in one data file - can not span data files;
An DB object is stored in a segment within a table space;
When creating a DB object, certain attributes need to be specified or use default values. Including initial segment size, how the segemnt grow, if auto-grow, the extention size.
Given this being said, there must be a optimiztion principles when design a database storage scheme. Physical environment, such as CPUs, drives, memory, is a major parameter. The database application requirement is also a determinitive factor.
No comments:
Post a Comment