First, you need to understand that the physical structure of the database is determined by the operating system files of the database, each Oracle database consists of three types of files: Data files, log files, and control files. The database's files provide true physical storage for database information.
Each Oracle database has one or more physical data files. A database data file contains all of the database data. The data for a logical database structure (such as tables, indexes, and so on) is physically stored in the data file of the database. The data file is usually in *.dbf format, for example: USERCIMS.DBF. Data files have the following characteristics: ①, a data file is only associated with one database; ②, once established, data files only increase; ③, a tablespace (a logical unit of database storage) consists of one or more data files.
Second, let's describe the logical structure of Oracle: The logical Structure of Oracle consists of a tablespace (tablespace), a segment (segment), a chunk (data block), and a schema object.
The Oracle database is logically composed of more than one table space, and the tablespace contains the data file or files physically. The data file size is an integer multiple of the block size, and the objects stored in the tablespace are called segments, such as data segments, index segments, and fallback segments. Segments are composed of zones, which are the smallest units of disk allocation. The increase of the segment is achieved by increasing the number of zones. The size of each area is an integer multiple of the block size, the size of the extents can be different, the data block is the smallest I/O unit in the database, and is also the unit of the memory data buffer, and the data file storage space unit. The size of the block is set by the parameter db_block_size, and its value should be set to an integer multiple of the operating system block size.
⑴, table space (tablespace)
A tablespace is the largest logical unit in a database, and each table space consists of one or more data files, and a data file can only be associated with one table space. Each database has a system tablespace that is created automatically during database creation or database installation, data dictionary tables for storage systems, program system units, process functions, packages, and triggers, and can also be used to store user data tables and indexed objects. Tablespaces have online and offline (offline) properties that allow you to place any table space except Systme offline.
⑵, Duan (segment)
The segments of a database can be divided into four categories: Data segments, index segments, fallback segments, and temporary segments.
⑶, District
Zone is the smallest unit of disk space allocation. Disks are partitioned, allocating at least one zone at a time. The zone is stored in a segment, which consists of contiguous blocks of data.
⑷, data block
The data block is the smallest data organization unit and Management Unit in the database, is the data file disk storage space unit, is also the smallest unit of database I/O, the block size is determined by the Db_block_size parameter, the default value of different Oracle version db_block_size is different.
⑸, Pattern Object
A schema object is an application that includes tables, clusters, views, index sequence generators, synonyms, hashes, program units, database chains, and so on.
Finally, consider the relationship between Oracle's user, tablespace, and data files:
One user can use one or more table spaces, and a table space can be used by multiple users. There is no affiliation between user and table space, which is a logical concept for managing data storage, which is only related to data files, data files are physical, a table space can contain multiple data files, and a data file can only belong to one table space.
To summarize: the best way to interpret a database, table space, data file, table, and data is to imagine a cupboard filled with things. The database is actually the cabinet, the drawer in the cabinet is a table space, the folder in the drawer is a data file, the folder of paper is a table, the information written on the paper is data.
Relationship between Oracle tablespace and data file