逻辑表空间管理结构(Logical Storage Structures)

Logical Storage Hierarchy

逻辑存储层级
Figure 12-2
 shows the relationships among data blocks, extents, and segments within a tablespace. In this example, a segment has two extents stored in different data files.

图12-2显示了表空间在数据块,区和段之间的关系,例如,一个段有两个区被存储在不同的数据文件上。

Figure 12-2 Segments, Extents, and Data Blocks Within a Tablespace

This graphic depicts the relationship between a Tablespace, Segment, Datafiles, Extents, and Data Blocks.

The tablespace holds one Segment of 96 Kb. The segment is divided into one extent of 24 Kb and another of 72 Kb, each of which is in a separate datafile. The 72 Kb extent maps to 12 rows of 2 Kb blocks, with 3 2 Kb blocks in each row. The 24 Kb extent maps to 12 2 Kb blocks.

这张图描述Lee表空间、段、数据文件、区和数据块之间的关系。
表空间拥有的一个96KB的段,这个段被分成了一个24KB的区和一个72KB的区,每一个都是区分属于一个单独的数据文件,72KB的区映射成了12行每行3个2KB的块。24KB的区映射成了一个12行每行一个2KB的块。

At the finest level of granularity, Oracle Database stores data in data blocks. One logical  data block  corresponds to a specific number of bytes of physical disk space, for example, 2 KB. Data blocks are the smallest units of storage that Oracle Database can use or allocate.

orale存放数据的最小单位是数据块。一个逻辑的数据块与指定数量的物理磁盘空间是一致的,例如,2KB的数据块是oracle数据库能够使用的最小的存储单位。

An  extent  is a set of logically contiguous data blocks allocated for storing a specific type of information. In  Figure 12-2 , the 24 KB extent has 12 data blocks, while the 72 KB extent has 36 data blocks.

一个区是逻辑相邻的被分配用来执行指定类型信息的数据块的集合。在图12-2中,24KB的区有12个数据块,而72KB的区有36个数据块。

segment is a set of extents allocated for a specific database object, such as a table. For example, the data for the employees table is stored in its owndata segment, whereas each index for employees is stored in its own index segment. Every database object that consumes storage consists of a single segment.

段是被分配存储指定数据库对象的区的集合
,例如表。例如,employees表的数据被存储在他自己的数据段中,而每个employees的索引都被存储在他自己的索引段中,每个消耗存储的数据库对象都是有单个的段构成的。

Each segment belongs to one and only one  tablespace . Thus, all extents for a segment are stored in the same tablespace. Within a tablespace, a segment can include extents from multiple data files, as shown in  Figure 12-2 . For example, one extent for a segment may be stored in users01.dbf , while another is stored in users02.dbf . A single extent can never span data files.

每个段只属于一个表空间,因此,所有的区都被存储在相同的表空间中,在表空间中,段可以包含多个数据文件的区,就像12-2中显示的那样,例如,一个段的区或许被存储在users01.dbf中,而另外一个区被存储在users02.dbf
中。单个的区只能在一个datafile中。

Logical Space Management

逻辑空间的管理
Oracle Database must use logical space management to track and allocate the extents in a tablespace. When a database object requires an extent, the database must have a method of finding and providing it. Similarly, when an object no longer requires an extent, the database must have a method of making the free extent available.

oracle必须使用逻辑的空间管理去追踪和分配表空间的区。当一个数据库对象需要一个区,数据库逆序有发现和提供它的方法,同样的,当一个对象不再需要一个区,数据库必须有方法释放这个区。

Oracle Database manages space within a tablespace based on the type that you create. You can create either of the following types of tablespaces:

oracle数据库根据创建表空间的类型管理空间。可以创建下列空间类型中的任一种:

Locally managed tablespaces (default)
本地管理的表空间(默认)

The database uses bitmaps in the tablespaces themselves to manage extents. Thus, locally managed tablespaces have a part of the tablespace set aside for a bitmap. Within a tablespace, the database can manage segments with automatic segment space management (ASSM) or manual segment space management (MSSM).

数据库使用表空间本身的位图管理区。因此,本地管理的表空间会有一部分空间留给位图。对于表空间,数据库能使用ASSM和MSSM管理段。

Dictionary-managed tablespaces
基于字典管理的表空间

The database uses the data dictionary to manage extents

数据库使用数据字典管理区

Figure 12-3 shows the alternatives for logical space management in a tablespace.

表12-3显示了两种表空间的逻辑管理方式


Locally Managed Tablespaces
A locally managed tablespace maintains a bitmap in the data file header to track free and used space in the data file body. Each bit corresponds to a group of blocks. When space is allocated or freed, Oracle Database changes the bitmap values to reflect the new status of the blocks.
本地管理的空间会在数据文件的头部维护
位图去追踪数据文件体部的空间是空还是非空。每一点都会对应一组块。当空间被分配或是被释放,oracle会改变位图的值去反应块的一个最新的状态。

The following graphic is a conceptual representation of bitmap-managed storage. A 1 in the header refers to used space, whereas a 0 refers to free space.
下个图是一个位图管理存储的概念图。头部的1代表已被用的空间,而0代表的是不用的空间。

This graphic shows a data file with the following numbers in its header: 1 0 0 1 0 1. The data file contains three rows of extents. The first five blocks are mostly full; the second 7 blocks are mostly empty; the next 7 blocks are mostly empty; the next 5 blocks are mostly full; the next 4 blocks are mostly empty; the next 8 blocks are mostly full.

这个图显示了数据文件头部的number号:1 0 0 1 0 1。
数据文件包含了三行的区。前五个块是满的,后7个块是空的;下一行的7个块是空的,后五个块是满的,下4个块是空的,下8个块是满的。

A locally managed tablespace has the following advantages:

Avoids using the data dictionary to manage extents

Recursive operations can occur in dictionary-managed tablespaces if consuming or releasing space in an extent results in another operation that consumes or releases space in a data dictionary table or undo segment.

一个本地管理的表空间有下列优点:
避免使用数据字典去管理区

在基于字典管理的表空间,如果占用或是释放区的空间会导致数据字典表和undo段的空间的占用和释放

  • Tracks adjacent free space automatically

    In this way, the database eliminates the need to coalesce free extents.

自动跟踪相邻的空闲空间

这样的话,数据库会评估需要整合的空闲区

  • Determines the size of locally managed extents automatically

    Alternatively, all extents can have the same size in a locally managed tablespace and override object storage options.

自动决定本地管理区的大小

作为一种选择,所有的在本地管理的表空的区都会有相同的大小并且覆盖对象存储的选项。

note:
Oracle strongly recommends the use of locally managed tablespaces with Automatic Segment Space Management.

oracle强烈推荐使用本地管理的ASSM的表空间
,oracle强烈推荐

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29802484/viewspace-1870677/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29802484/viewspace-1870677/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值