Oracle 11g R2 Storage Architecture

Source: Internet
Author: User

Data file related knowledge

To see how many data files are in the system we can view them through a Dynamic Data dictionary or a static data dictionary: View data files from a static data dictionary

View data files with a Dynamic Data dictionary

Viewing the contents of a data file directly is not visible, and you must view the contents of the data file through a logical structure, the tablespace. A table space is a logical storage structure, and a data file is a physical structure.

How to view table spaces

You can also view table spaces through Dba_tablespaces

Data dictionary is a logical storage structure, and the data file is a real storage structure, if there is a table space, and no data file is not possible, table space and data files are relative, if there is no data file, table space can not exist independently, if only the table space does not have a data file is not possible, Like if the computer does not have a hard disk, you can no longer logically see the C disk D, where the hard disk is the equivalent of a data file, and the C disk is equivalent to the table space. We can make multiple data files into a table space, and then store the data in the table space, table space and data files are corresponding, a table space can be composed of one or more data files, but a data file can only be in a table space, how can we see the table space and data file correspondence between?

You can also view the size of a table space

You can also create a new data file in the table space above. If the tablespace is not enough, just create the appropriate data file. The size of the table space is the sum of the size of the data file, the final data file is stored on the hard disk, but we can put the data file in a different hard disk, as long as in a table space, so that the size of the hard disk to the file limit, you can have more than one hard disk data files form a table space.

So in a tablespace, DBAs store a lot of objects such as tables, views, indexes, synonyms, and so on.

Segment: For example, in the XX table space, the DBA creates a table named Test, the space occupied by this table space, which we call a segment. Data segments, index segments, fallback segments, temporary segments, etc. are divided according to the different objects stored in the segment.

Can view information about a segment

There's a smaller unit for the segment, called the "district."

Zone (extent): Zone is the smallest unit of disk space allocation, the disk is partitioned, at least one zone is allocated each time, the area is composed of contiguous data blocks, the segment is mainly composed of one or more zones, when the segment is created, it contains at least one zone, when all the space in the paragraph has been used to complete, the system automatically allocated a Zones cannot exist across data files, only in one data file.

Paragraph is composed of the district, the segment must be an integer multiple of the area, if a table is 25MB, a size is 4MB, then the size of the segment is 28MB, if the table added 3MB data, the space can also accommodate the table, now the size of the table is 28MB, if added 1MB, at this time 29MB, Then the space of the paragraph is 32MB.

View the distribution of the extents and segments of the example table space

The smallest unit of storage in an Oracle database is a block of data in a--8kb,oracle database that is stored in a data block. The data block is the smallest storage unit that the Oracle server can read or write, and the Oracle server manages the storage space of the data file in blocks of data, with a value range of 2-64KB and a default size associated with the Oracle version.

View the minimum storage unit for the operating system

[Email protected] ~]# tune2fs-l/dev/sda1

This information can also be viewed by OEMs

Creating Tablespaces and Data files

Sql>create tablespace xx datafile '/u01/xx.dbf ' size 100m autoextend on

2 next 5m maxsize 200m;

The tablespace has been created.

Modify table space with the name yy


For good management, we want the name of the tablespace to be the same as the name of the data file.

Workaround:

    1. Copy a data file using the operating system command

    2. Offline the table space

    3. Then rename the data file


      Offline a tablespace


      Renaming the data file

      View Changes

      Put Tablespace online

      Prompt to restore/u01/yy.dbf

      Put Tablespace online


      How to extend table space size

    4. Change data file size directly


      2. Add data files to table spaces

If there is not enough space in the partition where the tablespace resides



Delete Table space

Create a temporary table space


Deleting a temporary tablespace is the same as a command to delete a table space.

If you have any questions about this article, please add the following discussion

Oracle 11g R2 Storage 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.