创建表空间时UNIFORM SIZE的通俗含义(翻译)

来源:互联网 发布:unity3d awake start 编辑:程序博客网 时间:2024/06/08 05:28

本文讨论创建表空间时,采用AutoAllocate扩展模式还是Uniform扩展模式.

官方文档解释如下:

If you expect the tablespace to contain objects of varying sizes
requiring many extents with different extent sizes, then AUTOALLOCATE
is the best choice. AUTOALLOCATE is also a good choice if it is not
important for you to have a lot of control over space allocation and
deallocation, because it simplifies tablespace management. Some space
may be wasted with this setting, but the benefit of having Oracle
Database manage your space most likely outweighs this drawback.

如果你希望你的表空间包含多种大小的扩展对象(扩展段),AutoAllocate 就是最好的选择。而且当你不怎么关心表空间的分配和回收,AutoAllocate也是一个很好的选择,因为它简化了表空间管理。当然当你采用这样的配置时,一些空间可能存在浪费,但是让Oracle数据库管理你的表空间将会让你获益更多(精力方面)。

If you want exact control over unused space, and you can predict
exactly the space to be allocated for an object or objects and the
number and size of extents, then UNIFORM is a good choice.

如果你想精细控制未分配的空间,同时你能准确的估计数据对象的数量和分配给数据对象使用空间的大小,那么Uniform就是一个很好的选择。

With AUTOALLOCATE extent management, Oracle uses the INITIAL setting
to optimize the number of extents allocated. Extents of 64K, 1M, 8M,
and 64M can be allocated. During segment creation, the system chooses
the greatest of these four sizes that is equal to or smaller than
INITIAL, and allocates as many extents of that size as are needed to
reach the INITIAL setting. For example, if you set INITIAL to 4M, then
the database creates four 1M extents.

采用AutoAllocate扩展管理,Oracle使用初始化设置来优化需要分配的扩展空间。扩展空间的选择有64K,1M,8M,64M。当进行扩展段创建时,初始,系统会从四个可选项中挑选出小于等于初始值的最大项,然后不断从四个可选项中选择合适项,直到达到初始设定值。比如你设定的初始值为4M,那么数据库将会创建4个1M的扩展。

■ For UNIFORM extent management, the number of extents is determined
from initial segment size and the uniform extent size specified at
tablespace creation time. For example, in a uniform locally managed
tablespace with 1M extents, if you specify an INITIAL value of 5M,
then Oracle creates five 1M extents. Consider this comparison: With
AUTOALLOCATE, if you set INITAL to 72K, then the initial segment size
will be 128K (greater than INITIAL). The database cannot allocate an
extent smaller than 64K, so it must allocate two 64K extents. If you
set INITIAL to 72K with a UNIFORM extent size of 24K, then the
database will allocate three 24K extents to equal 72K.

对于采用Uniform扩展管理,扩展段大小取决于,创建数据库时所设定的初始段大小和统一扩展段大小。举个例子,在Uniform扩展模式下设定每次增长1M,如果你指定初始值为5M,那么Oracle将会创建5个1M。现在我们来比较一下:采用AutoAllocate扩展模式,假设初始值为72K,那么最终Oracle数据库设置的段大小为128K(比初始值大)。因为数据库中没有扩展段小于64K,所以必须分配两个64K的扩展段。如果采用Uniform扩展模式,初始值仍为72K,每次统一扩展大小为24K,那么数据库将会分配3个24K大小的扩展,因为3*24K=72K;

0 0