An explanation of Oracle's logical architecture

Source: Internet
Author: User
Tags rollback

The previous knowledge of the database was mostly focused on MySQL, which has been using Oracle for the most recent work, although in the Internet industry MySQL is a big line, but some traditional industries or the financial sector are more inclined to use the large database oracle,sqlserver. It is also necessary to gain an in-depth understanding of some of the following Oracle's internal mechanisms.

Anyone with experience with Oracle knows the concept of tablespace (tablespace), which is actually a logical concept and does not actually exist. And it is closely related to the data file (datafile), the data file is actually present, and the table space is a lot to 1 of the relationship. In fact, only know that these are not enough, the previous period of time encountered a data file more than 32G led to business problems, only to suddenly wake up the Sao years quiet heart to learn some of the concepts of Oracle bottom is to solve the problem of the kingly. First, let's look at the logical architecture of Oracle as a whole. Here is attached a picture of Baidu to.

The largest logical structure of Oracle shown in the picture is the database, in fact, the largest architecture here should be an instance (instance), and the instance and database is a one-to-one relationship, so we can think of it as a divisible largest unit in the Oracle architecture. It can be seen that the largest database can be divided into table space, and the table space is composed of segments (segment), the segment is composed of extent, if the next point is block,oracle the concept of block is different from the concept of blocks in the operating system, this is explained later in this chapter. Let's take a look at some of the concepts described above:

Tablespace: The table space is the largest logical unit that Oracle abstracts to store database objects. The concepts associated with tablespace are data files that can be dba_data_files to see the relationship between tablespaces and data files.

Table Space Classification:

        • Persistent tablespace : Stores objects in the database that need to be persisted, such as two-dimensional tables, views, stored procedures, indexes.
        • Staging tablespace : Stores the intermediate execution of the database, such as saving the order by database sorting, and the temporary data that is generated when grouping. The stored content is automatically freed when the operation is completed. The temporary tablespace is generic, and the user uses temp as the temporary table space. Typically only TMP is a temporary tablespace, which you can create yourself if you need another temporary table space.
        • undo Tablespace : Saves a copy of the data before it is modified. The site where the transaction was modified, i.e. the data before it was modified. When we modify the data in a table, we save the information before the modification, in order to perform rollback, recovery, and undo operations on the data.

Segment: A segment is a generic term that occupies data file space, or a collection of space used by database objects, and segments can have a table segment, an index segment, a rollback segment, a temporary segment, a cache segment, and so on. Speaking of this, it is necessary to mention the table segment, because if the table is a partitioned table, a partition of the table occupies one segment.

Segment Category: Because Oracle is more in the middle, here we simply say some of the more common segments.

        • Table segment: A table segment, therefore, it is a data structure that is specifically used to store information about a table and is typically used in conjunction with an index segment.
        • Sub-section: This segment type is used for partitioning, very similar to a table segment. A partitioned table consists of one or more table sections, and the combined partition table consists of one or more sub-sections of the table.
        • Index segment: This segment type can save the index structure, similar to MySQL, in MySQL mysiam storage engine under the index and the data is separate, and the InnoDB engine is stored together.
        • Index partition: Similar to a table partition, this segment type contains one slice of an index. A partitioned index consists of one or more indexed sections.
        • Temporary segment: Used to hold temporary data, such as SQL with an order BY statement, to store data in a temporary segment.
        • Rollback segment: The rollback segment is a segment that is created manually by the DBA. The Type2 undo segment is created and managed automatically by Oracle.
        • There are many other paragraphs, interested in the study of a ha.

Zone: An area is a logical unit of blocks in Oracle that allocates extents when a table is created in 10G, and in 11G and beyond when data is inserted. The allocation of the zone is dynamic, and the new zone is added automatically when the capacity of the table exceeds the range that the current zone can carry. This content can be viewed through the dba_extents table.

Blocks: Oracle blocks are built on the basis of database blocks, usually Oracle blocks can be 2,4,8,16,32k, which is an integer multiple of the system block, and cannot be modified after the definition. Introduce a problem that has been encountered in the previous period: The Oracle data file exceeds 32G, causing the business to fail. This is because the test environment uses the Smallfile tablespace mode, so the following constraints need to be met:

Since Oracle's ROWID uses 22 bits to represent the block number, the 22 bits can represent only 2^22-1 (4194303) blocks, and in general we use a block size of 8k, so the maximum theoretical size of the data file is: 31.9999924G, And when the data file exceeds 32G, the only thing that can be done is to add a datafile.

An explanation of Oracle's logical architecture

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.