The logical structure of a database includes data blocks, zones, segments, and tablespaces.
OracleThe data block is ORacleDatabase storage base, which consists of several bytes of disk space. The data block isOracleThe minimum logical unit of the database. You can define the data block2 k,4 k,8 k,16 k,32 kLarger, defaultOracle
The block size is8 kWhich is usually calledOracleBlock. Of course, under normal circumstancesOracleThe block should beOSA block is an integer multiple. Of course, a block with a standard size is called a standard block. A block different from a standard block is called a non-standard block. In the same database, of course, it refers9iIn the future, both standard and non-standard blocks can be used in the same data.
OracleThe block size is set in the initialization parameter file (Init. ora).Db_block_sizeBlock is processingUpdate,Insert,SelectThe minimum unit of Data transactions. When you select data from a tableOracleBlock to read or extract data. Meaning:OSEach executionI/oThe time isOSThe unit of blocks;OracleEach executionI/oThe time isOracleThe Unit is block.
Summary:
•MinimumI/OUnit
•Contains one or moreOSBlock
•DB_BLOCK_SIZE
•Set during database creation,The database cannot be changed after it is created.
OracleOpinions on data block size setting:
1,If the row size is small and the access is random, select a small block size.
2,If the row is small and the access is continuous, or there is a large row, select a large block.
That is to say, let's look at our business system.
Data Block Structure
The block structure is described as follows:
Block header: stores some basic information, such as the physical location and the block type (Data Segment, index segment, and rollback segment)
Table Directory: if the data stored in the block is table data, the table directory stores information about the table.
Row Directory: if the data stored in the block is table data, the row directory stores information about the data rows.
Header information (Overhead), This Part does not store the actual data in the database, but is used to record the logical structure of the block, and the space occupied by this part is not fixed, about84-107Bytes.
Row record: the region where data is stored. This space is used.
Free Space: unused area, used for inserting new rows or updating existing rows. (Here we have a concept line migration: WhenUpdateDuring the operation, if there is not enough free space in the block to save the modified data, the record will be saved to another block with sufficient space, and only one record pointing to the new block will be retained on the original block.RowidThis is row migration.Row migration)