ShineCQY 发表于 2013-12-16 14:33:06

对于ASM extent大小分配的疑问

本帖最后由 ShineCQY 于 2013-12-16 14:38 编辑

看到官方文档上这样说:
The extent size of a file varies as follows:
■ Extent size always equals the disk group AU size for the first 20000 extent sets (0 -
19999).
■ Extent size equals 4*AU size for the next 20000 extent sets (20000 - 39999).
■ Extent size equals 16*AU size for the next 20000 and higher extent sets (40000+).
Figure 1–4shows the Oracle ASM file extent relationship with allocation units. The
first eight extents (0 to 7) are distributed onfour Oracle ASM disks and are equal to the
AU size. After the first 20000 extent sets, the extent size becomes 4*AU for the next
20000 extent sets (20000 - 39999). This is shown as bold rectangles labeled with the
extent set numbers 20000 to 20007, and so on. The next increment for an Oracle ASM
extent is 16*AU (not shown in Figure 1–4).
在数据量很小的虚拟机上测试了下,是符合第一条规律的,extents<20000 extent的大小等于一个AU(默认的1m)
但是在生产环境(仓库)却不是这样。
SYS@+ASM1>SELECT xnum_kffxp,count(*)
    FROM x$kffxp
    WHERE group_kffxp=2
    group BY xnum_kffxp
    having count(*)<2
    order by 2 asc
    ;

no rows selected

SYS@+ASM1>SELECT xnum_kffxp,count(*)
    FROM x$kffxp
    WHERE group_kffxp=2
    group BY xnum_kffxp
    having count(*)=4
    order by 2 asc
    ;

no rows selected

SYS@+ASM1>SELECT xnum_kffxp,count(*)
    FROM x$kffxp
    WHERE group_kffxp=2
    group BY xnum_kffxp
    having count(*)=16;

no rows selected
为什么会这样呢?是我的测试方法有误还是oracle 不遵循自己公开的理论?
如果Oracle 的说法是正确的,那么在我的数据仓库中查询,第一个结果应该是20000行数据。第二个 2000行数据。第三个4000行以上。

lunar 发表于 2013-12-16 15:15:44

ASM的metadata结构不只是extent,还包括file directory,disk directory,PST等等,我也不是很懂,但是你的查询我感觉有问题,比如,如果我要看AU的分布,我就用下面的语句:
select disk_kffxp, AU_kffxp, xnum_kffxp
from x$kffxp
where group_kffxp=1 -- Diskgroup 1
and number_kffxp=1 -- File 1 ,即 file directory
;

$ ss

SQL*Plus: Release 12.1.0.1.0 Production on Thu Nov 28 05:29:16 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Automatic Storage Management option

SYS@+ASM>select disk_kffxp, AU_kffxp, xnum_kffxp
  2  from x$kffxp
  3  where group_kffxp=1
  4  and number_kffxp=1
  5  ;

DISK_KFFXP   AU_KFFXP XNUM_KFFXP
---------- ---------- ----------
         0         10          0
         0         61          1

Elapsed: 00:00:00.00
SYS@+ASM>
我这个含义是disk 0上分配了AU 10和AU 61,他们属于fiile 1,我的是1M的AU,4K的ASM block,1M/4k=255,因此第一个AU可以包含255个file directory

。。。。。

其实我也不是特别懂ASM的存储细节,但是,你的这种方法,不对,应该知道还有很多关联结构在里面,需要一个个比对着看,O(∩_∩)O哈哈~





页: [1]
查看完整版本: 对于ASM extent大小分配的疑问