The logical structure of ORACLE is composed of one or more table spaces. A database is divided into one or more logical units. This logical unit is called a table space. A tablespace groups related logical structures together.
A table space consists of a set of classification segments.
A segment consists of a set of ranges.
A range consists of a batch of database blocks.
A database block corresponds to one or more physical blocks.
Each ORACLE database contains a table space named SYSTEM, which is automatically created when the database is created. This table space contains the system information data of the entire database. The smallest database only needs the SYSTEM table space. The table space can be expanded by adding data files. The size of the table space is the sum of the sizes of the data files that make up the table space. A table space in the ORACLE database is composed of one or more physical data files, and one data file can only be associated with one table space. When creating a data file for a table space, ORACLE creates the file and allocates the specified disk space capacity. After the data file is initially created, the allocated disk does not contain any data.
A schema is a collection of schema objects, and each database user corresponds to a schema. Schema objects are logical structures that directly reference database data. Schema objects include structures such as tables, views, indexes, and synonyms. Schema objects are logical data storage structures, and each schema object does not have a corresponding file on disk to store its information. A schema object is logically stored in a table space in the database, and the data for each object is physically contained in one or more data files in the table space. For example: schema objects such as tables and indexes, how much space is allocated for this object on the data file of the specified table space. Figure 1-5 illustrates the relationship between schema objects, table spaces, and data files.
The relationship between schema and table space is: one table space can contain objects of different schemas, and objects in one schema can be contained in different table spaces.
1. Database block
Database block is the lowest layer of ORACLE logical allocation space, also known as logical block, page or ORACLE block.
A database block is the smallest unit of space used and allocated by the database. It can also be said to be the smallest I/O unit used. A data block is consistent with the size of the physical space specified on the disk. A database block corresponds to one or more physical blocks. The size of the block is determined by the parameter db_block_size.
PCTFREE and PCTUSED are parameters used by developers to control the amount of free space available in a data block for inserting and updating data.
PCTFREE: Set the percentage of data blocks that remain free.
PCTUSED: When the free space of the data block reaches PCTFREE, data is not allowed to be inserted into this block. Only rows in the block can be modified or deleted. When updating, the free space of the data block may become larger and the used data space becomes smaller. When the data block has been When the used space is lower than PCTUSED, data can be re-inserted.
Selection of PCTFREE and PCTUSED:
For tables that are frequently queried (selected), PCTFREE should be made smaller to minimize waste of storage space.
For tables that frequently perform inserts, PCTUSED should be larger.
For tables that are frequently updated, the PCTFREE should be larger to leave more space for updates and reduce row movement.
Note:
These two parameters can only be specified when creating or modifying tables and clusters (data segments). In addition, only the PCTFREE parameter can be specified when creating or modifying an index (index segment).
Examples of table settings that are frequently inserted:
create table COMMINFOR
( SERIALNUMBER TBEGINTIME DATE null ,
ACCEPTDURATION NUMBER(10) null ,
ACCEPTERNO VARCHAR2(4) null ,
CALLINGPHONENO VARCHAR2(20) null ,
ACCEPTID NUMBER(10) null ,)
The above is the logical structure in the ORACLE database, please pay attention to PHP Chinese for more related articles Net (www.php.cn)!