Relationship between Oracle database users, tables, and tablespaces

Source: Internet
Author: User

First, you must 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. Database files provide real physical storage for database information.

Each Oracle database has one or more physical data files ). A database data file contains all the database data. Data in logical database structures (such as tables and indexes) is physically stored in database data files. Data files are usually in *. dbf format, for example, userCIMS. dbf. A data file has the following features: ①. A data file is associated with only one database; ②. Once a data file is created, it only increases or decreases; ③. A tablespace (logical unit of database storage) it consists of one or more data files.

Next, let's talk about the logical structure of Oracle: the logical structure of Oracle includes tablespaces, segments, data blocks, and schema objects ).

Oracle databases are logically composed of multiple tablespaces, which physically contain one or more data files. The data file size is an integer multiple of the block size. The objects stored in the tablespace are called segments, such as data segments, index segments, and rollback segments. Segments are composed of zones, which are the smallest unit allocated to disks. The increase of segments is achieved by increasing the number of segments. The size of each partition is an integer multiple of the size of the data block. The size of each partition can be different. The data block is the smallest I/O unit in the database and also the unit of the memory data buffer, and data file storage space units. The block size is set by the DB_BLOCK_SIZE parameter, and its value should be set to an integer multiple of the operating system block size.

(1) Table space)

A tablespace is the largest logical unit in a database. Each tablespace consists of one or more data files. A data file can only be associated with one tablespace. Each database has a SYSTEM tablespace that is automatically created during database creation or database installation. It is used to store the SYSTEM's data dictionary tables, Program SYSTEM units, and process functions, packages and triggers can also be used to store user data tables and index objects. Table spaces have the online and offline attributes. You can set any table space other than tablespace me to offline.

(2) segment (segment)

Database segments can be divided into data segments, index segments, rollback segments, and temporary segments.

(3) Zone

The partition is the minimum unit for disk space allocation. The disk is divided by zone. At least one zone is allocated each time. Block Storage and segments, which are composed of continuous data blocks.

(4) data blocks

A data block is the smallest unit of data organization and management in a database. It is the unit of data file disk storage space and the smallest unit of database I/O. The data block size is determined by the DB_BLOCK_SIZE parameter, the default value of DB_BLOCK_SIZE varies with Oracle versions.

Mode object

A schema object is an application that includes tables, clustering, views, index sequence generators, synonyms, hashing, program units, and database chains.

Finally, let's talk about the relationship between Oracle users, tablespaces, and data files:

One user can use one or more tablespaces. One tablespace can also be used by multiple users. There is no affiliation between the user and the tablespace. The tablespace is a logical concept used to manage data storage. The tablespace is only related to the data file, and the data file is physical, a tablespace can contain multiple data files, and a data file can only belong to one tablespace.

Summary: The best way to explain databases, tablespaces, data files, tables, and data is to imagine a cabinet filled with stuff. The database is actually a Cabinet, the drawer in the cabinet is a tablespace, the folder in the drawer is a data file, the paper in the folder is a table, and the information written on the paper is data.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.