Oracle 11g asm中不同au size下datafile的au分布初探
本站文章除注明转载外,均为本站原创: 转载自love wife love life —Roger的Oracle/MySQL/PostgreSQL数据恢复博客
今天有朋友问11g中asm 的au size不为1m的情况下,datafile的au 分布是怎么样的?通过10g的方式去kfed read,
发现不对了,原帖地址:~~【高手请进】在oracle11g中通过kfed找到ASM AU空间分布信息?
下午花了一点时间研究了一下,其中还有些没有明白,不过基本上搞清楚了,下面是简单的实验过程:
开始我也没明白其中的关系,首先尝试用strace 去跟踪amdu的过程,我们知道amdu是可以直接抽取datafile的,开始
我是这样想的:既然amdu在读取asm disk的时候,可以直接将文件读取出来,那么也就比如需要现在知道该datafile的
au 分布情况,于是我使用strace 进行跟踪,完全没有搞明白,如下:
命令如下:strace -o amdu.log amdu -dis ‘/dev/sdb’ -extract data2.256
其中产生的部分log信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
stat64("/dev/sdb", {st_mode=S_IFBLK|0777, st_rdev=makedev(8, 16), ...}) = 0 access("/dev/sdb", F_OK) = 0 statfs("/dev/sdb", {f_type=0x1021994, f_bsize=4096, f_blocks=129388, f_bfree=129358, f_bavail=129358, f_files=129388, f_ffree=128781, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 open("/dev/sdb", O_RDWR|O_LARGEFILE) = 7 mmap2(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb759d000 --257 _llseek(7, 0, [0], SEEK_SET) = 0 read(7, "\1\202\1\1\0\0\0\0\0\0\0\200\2519\325\222\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576 _llseek(7, 1048576, [1048576], SEEK_SET) = 0 --256 read(7, "\1\202\3\1\0\1\0\0\0\0\0\200\241?\303\257\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576 _llseek(7, 2097152, [2097152], SEEK_SET) = 0 --512 read(7, "\1\202\3\1\0\2\0\0\0\0\0\200\241\374\301\257\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576 _llseek(7, 3145728, [3145728], SEEK_SET) = 0 --768 read(7, "\1\202\3\1\0\3\0\0\0\0\0\200\241\275\307\257\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576 stat64("/dev/sdb", {st_mode=S_IFBLK|0777, st_rdev=makedev(8, 16), ...}) = 0 access("/dev/sdb", F_OK) = 0 statfs("/dev/sdb", {f_type=0x1021994, f_bsize=4096, f_blocks=129388, f_bfree=129358, f_bavail=129358, f_files=129388, f_ffree=128781, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 open("/dev/sdb", O_RDWR|O_LARGEFILE) = 8 _llseek(8, 8384512, [8384512], SEEK_SET) = 0 ---2047 read(8, "\1\202\23\1\377\7\0\0\0\0\0\200_\204\324\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096 open("/home/ora11g/11.2/grid/rdbms/mesg/amduus.msb", O_RDONLY) = 9 fcntl64(9, F_SETFD, FD_CLOEXEC) = 0 lseek(9, 0, SEEK_SET) = 0 read(9, "\25\23\"\1\23\3\t\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256) = 256 lseek(9, 512, SEEK_SET) = 512 read(9, "Z\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512 lseek(9, 1024, SEEK_SET) = 1024 read(9, "\311\0\323\0/\1\223\1Z\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512 lseek(9, 2048, SEEK_SET) = 2048 read(9, "\n\0\312\0\1\0D\0\313\0\1\0\\\0\314\0\1\0\200\0\315\0\1\0\257\0\316\0\2\0\333\0"..., 512) = 512 lseek(9, 512, SEEK_SET) = 512 read(9, "Z\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512 lseek(9, 1024, SEEK_SET) = 1024 read(9, "\311\0\323\0/\1\223\1Z\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512 lseek(9, 1536, SEEK_SET) = 1536 read(9, "\f\0d\0\0\0P\0e\0\1\0q\0f\0\1\0\244\0g\0\1\0\315\0h\0\2\0\334\0"..., 512) = 512 write(2, "AMDU-00204: Disk N0001 is in cur"..., 63) = 63 write(2, "AMDU-00201: Disk N0001: '/dev/sd"..., 35) = 35 write(4, "AMDU-00204: Disk N0001 is in cur"..., 63) = 63 write(4, "AMDU-00201: Disk N0001: '/dev/sd"..., 35) = 35 write(4, "** HEARTBEAT DETECTED **\n", 25) = 25 munmap(0xb759d000, 1052672) = 0 close(7) = 0 close(8) = 0 write(4, " Allocated AU's: 24\n", 30) = 30 ---这里其实是比较关键的,到这里为止,amdu起码就知道了au的分布情况了。 write(4, " Free AU's: 488\n", 31) = 31 write(4, " AU's read for dump: 0\n", 29) = 29 write(4, " Block images saved: 0\n", 29) = 29 write(4, " Map lines written: 0\n", 29) = 29 write(4, " Heartbeats seen: 1\n", 29) = 29 write(4, " Corrupt metadata blocks: 0\n", 29) = 29 write(4, " Corrupt AT blocks: 0\n", 29) = 29 write(4, "\n", 1) = 1 write(4, "\n", 1) = 1 write(4, "------------------------ SUMMARY"..., 79) = 79 write(4, " Allocated AU's: 24\n", 30) = 30 write(4, " Free AU's: 488\n", 31) = 31 write(4, " AU's read for dump: 0\n", 29) = 29 write(4, " Block images saved: 0\n", 29) = 29 write(4, " Map lines written: 0\n", 29) = 29 write(4, " Heartbeats seen: 1\n", 29) = 29 write(4, " Corrupt metadata blocks: 0\n", 29) = 29 write(4, " Corrupt AT blocks: 0\n", 29) = 29 write(4, "\n", 1) = 1 |
首先来看看statfs部分:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
statfs("/dev/sdb", {f_type=0x1021994, f_bsize=4096, f_blocks=129388, f_bfree=129358, f_bavail=129358, f_files=129388, f_ffree=128781, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 该函数的结构: int statfs(const char *path, struct statfs *buf); 该函数的详细参数解析: struct statfs { long f_type; /* 文件系统类型 */ long f_bsize; /* 经过优化的传输块大小 */ long f_blocks; /* 文件系统数据块总数 */ long f_bfree; /* 可用块数 */ long f_bavail; /* 非超级用户可获取的块数 */ long f_files; /* 文件结点总数 */ long f_ffree; /* 可用文件结点数 */ fsid_t f_fsid; /* 文件系统标识 */ long f_namelen; /* 文件名的最大长度 */ }; 从上面可以得出整个/dev/sdb的情况如下: block大小为4096; 总的block为:129388个 可用的block为:129358 ---所以用掉的block也就是30个。 关于llseek函数: _llseek(8, 8384512, [8384512], SEEK_SET) = 0 关于该函数的描述为:_llseek - reposition read/write file offset 8384512 指的是offset,由于block大小为4096,所以8384512/4096=2047 |
纠结了一段时间,上面的东西,看的眼睛都花了,也没有搞清楚是怎么一个具体的关系,无奈又回到老方法上去。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
SQL> conn /as sysasm Connected. SQL> create diskgroup data2 external redundancy disk '/dev/sdb' ATTRIBUTE 'au_size' = '4M'; Diskgroup created. SQL> SQL> SELECT 2 name group_name 3 , sector_size sector_size 4 , block_size block_size 5 , allocation_unit_size allocation_unit_size 6 , state state 7 , type type 8 , total_mb total_mb 9 , (total_mb - free_mb) used_mb 10 , ROUND((1- (free_mb / total_mb))*100, 2) pct_used 11 FROM 12 v$asm_diskgroup 13 ORDER BY 14 name 15 / Disk Group Sector Block Allocation Name Size Size Unit Size State Type Total Size (MB) Used Size (MB) Pct. Used -------------------- ------- ------- ------------ ----------- ------ --------------- -------------- --------- DATA1 512 4,096 1,048,576 MOUNTED EXTERN 4,096 2,196 53.61 DATA2 512 4,096 4,194,304 MOUNTED EXTERN 2,048 72 3.52 --------------- -------------- Grand Total: 6,144 2,268 ---创建一个test 表空间在新的磁盘组上。 SQL> select file_name from dba_data_files; FILE_NAME -------------------------------------------------------------------------------- +DATA1/roger/users01.dbf +DATA1/roger/sysaux01.dbf +DATA1/roger/system01.dbf +DATA1/roger/roger01.dbf +DATA1/roger/undotbs.dbf SQL> create tablespace test datafile '+DATA2' size 20m; Tablespace created. SQL> select file_name from dba_data_files; FILE_NAME -------------------------------------------------------------------------------- +DATA1/roger/users01.dbf +DATA1/roger/sysaux01.dbf +DATA1/roger/system01.dbf +DATA1/roger/roger01.dbf +DATA1/roger/undotbs.dbf +DATA2/roger/datafile/test.256.792368543 6 rows selected. SQL> SQL> col path for a30 SQL> l 1 select a.GROUP_KFFXP, a.DISK_KFFXP, a.AU_KFFXP, b.path 2 from x$kffxp a, v$asm_disk b, v$asm_alias c 3 where a.number_kffxp = c.file_number 4 and a.GROUP_KFFXP = b.group_number 5 and a.disk_kffxp = b.disk_number 6 and b.group_number=2 7 and c.name like '%TEST%' 8* order by a.AU_KFFXP SQL> / GROUP_KFFXP DISK_KFFXP AU_KFFXP PATH ----------- ---------- ---------- ------------------------------ 2 0 18 /dev/sdb 2 0 19 /dev/sdb 2 0 20 /dev/sdb 2 0 21 /dev/sdb 2 0 22 /dev/sdb 2 0 23 /dev/sdb 6 rows selected. |
使用kfed 读取disk au信息:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
[ora11g@11gR2test db]$ kfed read /dev/sdb aun=0 blkn=0|grep f1 kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002 [ora11g@11gR2test db]$ [ora11g@11gR2test db]$ kfed read /dev/sdb aun=2 blkn=1|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 513 ; 0x004: T=0 NUMB=0x201 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0 kfbh.check: 2948726368 ; 0x00c: 0xafc1fe60 kfbh.fcn.base: 0 ; 0x010: 0x00000000 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 kfdatb10.aunum: 228928 ; 0x000: 0x00037e40 kfdatb10.shrink: 0 ; 0x004: 0x0000 kfdatb10.ub2pad: 12001 ; 0x006: 0x2ee1 kfdatb10.auinfo[0].link.next: 8 ; 0x008: 0x0008 kfdatb10.auinfo[0].link.prev: 8 ; 0x00a: 0x0008 kfdatb10.auinfo[0].free: 0 ; 0x00c: 0x0000 kfdatb10.auinfo[0].total: 0 ; 0x00e: 0x0000 kfdatb10.auinfo[1].link.next: 16 ; 0x010: 0x0010 kfdatb10.auinfo[1].link.prev: 16 ; 0x012: 0x0010 kfdatb10.auinfo[1].free: 0 ; 0x014: 0x0000 kfdatb10.auinfo[1].total: 0 ; 0x016: 0x0000 kfdatb10.auinfo[2].link.next: 24 ; 0x018: 0x0018 kfdatb10.auinfo[2].link.prev: 24 ; 0x01a: 0x0018 kfdatb10.auinfo[2].free: 0 ; 0x01c: 0x0000 kfdatb10.auinfo[2].total: 0 ; 0x01e: 0x0000 kfdatb10.auinfo[3].link.next: 32 ; 0x020: 0x0020 kfdatb10.auinfo[3].link.prev: 32 ; 0x022: 0x0020 kfdatb10.auinfo[3].free: 0 ; 0x024: 0x0000 kfdatb10.auinfo[3].total: 0 ; 0x026: 0x0000 kfdate[0].discriminator: 1 ; 0x028: 0x00000001 kfdate[0].allo.lo: 0 ; 0x028: XNUM=0x0 kfdate[0].allo.hi: 9437183 ; 0x02c: V=1 I=0 H=0 FNUM=0xfffff kfdate[1].discriminator: 1 ; 0x030: 0x00000001 kfdate[1].allo.lo: 0 ; 0x030: XNUM=0x0 .....省略部分情况 |
很多人不明白,11g里面,让au size不是1m的情况下,通过去看aun=2,发现对于的au分布是不对的,其实很简单。
我们这里要注意上面的kfdatb10.auinfo[0].link.next: 8 ; 0x008: 0x0008
开始我也不清楚这里是什么意思,我猜测11g应该是在10g的基础上进行扩展,那么也就是说整体结构应该不会变化。
换句话说,也就是这个link.next 也就是下一个对于的AU,我们应该到这个AU里面去找对应的分布。
由于我们前面的test datafile的asm number是256,所以我们直接看第256个即可,这里需要注意一点的是,
对于我这里4m的au size,每个au是可以容纳1024个block的,跟以前1m的情况是不同的。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
[ora11g@11gR2test db]$ kfed read /dev/sdb aun=8 blkn=256|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 4 ; 0x002: KFBTYP_FILEDIR kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 256 ; 0x004: T=0 NUMB=0x100 kfbh.block.obj: 1 ; 0x008: TYPE=0x0 NUMB=0x1 kfbh.check: 1715174132 ; 0x00c: 0x663b7af4 kfbh.fcn.base: 22 ; 0x010: 0x00000016 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 kfffdb.node.incarn: 792368543 ; 0x000: A=1 NUMM=0x179d4acf kfffdb.node.frlist.number: 4294967295 ; 0x004: 0xffffffff kfffdb.node.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0 kfffdb.hibytes: 0 ; 0x00c: 0x00000000 kfffdb.lobytes: 20979712 ; 0x010: 0x01402000 kfffdb.xtntcnt: 6 ; 0x014: 0x00000006 kfffdb.xtnteof: 6 ; 0x018: 0x00000006 kfffdb.blkSize: 8192 ; 0x01c: 0x00002000 kfffdb.flags: 17 ; 0x020: O=1 S=0 S=0 D=0 C=1 I=0 R=0 A=0 kfffdb.fileType: 2 ; 0x021: 0x02 kfffdb.dXrs: 17 ; 0x022: SCHE=0x1 NUMB=0x1 kfffdb.iXrs: 17 ; 0x023: SCHE=0x1 NUMB=0x1 kfffdb.dXsiz[0]: 4294967295 ; 0x024: 0xffffffff kfffdb.dXsiz[1]: 0 ; 0x028: 0x00000000 kfffdb.dXsiz[2]: 0 ; 0x02c: 0x00000000 kfffdb.iXsiz[0]: 4294967295 ; 0x030: 0xffffffff kfffdb.iXsiz[1]: 0 ; 0x034: 0x00000000 kfffdb.iXsiz[2]: 0 ; 0x038: 0x00000000 kfffdb.xtntblk: 6 ; 0x03c: 0x0006 kfffdb.break: 60 ; 0x03e: 0x003c kfffdb.priZn: 0 ; 0x040: KFDZN_COLD kfffdb.secZn: 0 ; 0x041: KFDZN_COLD kfffdb.ub2spare: 0 ; 0x042: 0x0000 kfffdb.alias[0]: 106 ; 0x044: 0x0000006a kfffdb.alias[1]: 4294967295 ; 0x048: 0xffffffff kfffdb.strpwdth: 1 ; 0x04c: 0x01 kfffdb.strpsz: 22 ; 0x04d: 0x16 kfffdb.usmsz: 0 ; 0x04e: 0x0000 kfffdb.crets.hi: 32973654 ; 0x050: HOUR=0x16 DAYS=0x1a MNTH=0x8 YEAR=0x7dc kfffdb.crets.lo: 1500018688 ; 0x054: USEC=0x0 MSEC=0x21e SECS=0x16 MINS=0x16 kfffdb.modts.hi: 32973654 ; 0x058: HOUR=0x16 DAYS=0x1a MNTH=0x8 YEAR=0x7dc kfffdb.modts.lo: 0 ; 0x05c: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0 kfffdb.dasz[0]: 0 ; 0x060: 0x00 .....省略部分内容 kfffdb.usm: ; 0x0a0: length=0 kfffde[0].xptr.au: 18 ; 0x4a0: 0x00000012 kfffde[0].xptr.disk: 0 ; 0x4a4: 0x0000 kfffde[0].xptr.flags: 0 ; 0x4a6: L=0 E=0 D=0 S=0 kfffde[0].xptr.chk: 56 ; 0x4a7: 0x38 kfffde[1].xptr.au: 19 ; 0x4a8: 0x00000013 kfffde[1].xptr.disk: 0 ; 0x4ac: 0x0000 kfffde[1].xptr.flags: 0 ; 0x4ae: L=0 E=0 D=0 S=0 kfffde[1].xptr.chk: 57 ; 0x4af: 0x39 kfffde[2].xptr.au: 20 ; 0x4b0: 0x00000014 kfffde[2].xptr.disk: 0 ; 0x4b4: 0x0000 kfffde[2].xptr.flags: 0 ; 0x4b6: L=0 E=0 D=0 S=0 kfffde[2].xptr.chk: 62 ; 0x4b7: 0x3e kfffde[3].xptr.au: 21 ; 0x4b8: 0x00000015 kfffde[3].xptr.disk: 0 ; 0x4bc: 0x0000 kfffde[3].xptr.flags: 0 ; 0x4be: L=0 E=0 D=0 S=0 kfffde[3].xptr.chk: 63 ; 0x4bf: 0x3f kfffde[4].xptr.au: 22 ; 0x4c0: 0x00000016 kfffde[4].xptr.disk: 0 ; 0x4c4: 0x0000 kfffde[4].xptr.flags: 0 ; 0x4c6: L=0 E=0 D=0 S=0 kfffde[4].xptr.chk: 60 ; 0x4c7: 0x3c kfffde[5].xptr.au: 23 ; 0x4c8: 0x00000017 kfffde[5].xptr.disk: 0 ; 0x4cc: 0x0000 kfffde[5].xptr.flags: 0 ; 0x4ce: L=0 E=0 D=0 S=0 kfffde[5].xptr.chk: 61 ; 0x4cf: 0x3d kfffde[6].xptr.au: 4294967295 ; 0x4d0: 0xffffffff kfffde[6].xptr.disk: 65535 ; 0x4d4: 0xffff kfffde[6].xptr.flags: 0 ; 0x4d6: L=0 E=0 D=0 S=0 kfffde[6].xptr.chk: 42 ; 0x4d7: 0x2a |
下面我们再来看看au size为8m和16m的情况。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
---For AU size 8m、16m SQL> select status from v$instance; STATUS ------------ OPEN SQL> drop tablespace test including contents and datafiles; Tablespace dropped. SQL> SQL> select instance_name from v$instance; INSTANCE_NAME ---------------- +ASM SQL> drop diskgroup data2; Diskgroup dropped. SQL> create diskgroup data2 external redundancy disk '/dev/sdb' 'au_size' = '8M'; create diskgroup data2 external redundancy disk '/dev/sdb' 'au_size' = '8M' * ERROR at line 1: ORA-00933: SQL command not properly ended SQL> create diskgroup data2 external redundancy disk '/dev/sdb' ATTRIBUTE 'au_size' = '8M'; Diskgroup created. SQL> create diskgroup data3 external redundancy disk '/dev/sdc' ATTRIBUTE 'au_size' = '16M'; Diskgroup created. SQL> SELECT 2 name group_name 3 , sector_size sector_size 4 , block_size block_size 5 , allocation_unit_size allocation_unit_size 6 , state state 7 , type type 8 , total_mb total_mb 9 , (total_mb - free_mb) used_mb 10 , ROUND((1- (free_mb / total_mb))*100, 2) pct_used 11 FROM 12 v$asm_diskgroup 13 ORDER BY 14 name 15 / Disk Group Sector Block Allocation Name Size Size Unit Size State Type Total Size (MB) Used Size (MB) Pct. Used -------------------- ------- ------- ------------ ----------- ------ --------------- -------------- --------- DATA1 512 4,096 1,048,576 MOUNTED EXTERN 4,096 2,196 53.61 DATA2 512 4,096 8,388,608 MOUNTED EXTERN 2,048 104 5.08 DATA3 512 4,096 16,777,216 MOUNTED EXTERN 2,048 160 7.81 --------------- -------------- Grand Total: 8,192 2,460 SQL> SQL> SELECT 2 NVL(a.name, '[CANDIDATE]') disk_group_name 3 , b.path disk_file_path 4 , b.name disk_file_name 5 , b.failgroup disk_file_fail_group 6 , b.total_mb total_mb 7 , (b.total_mb - b.free_mb) used_mb 8 , ROUND((1- (b.free_mb / b.total_mb))*100, 2) pct_used 9 FROM 10 v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number) 11 ORDER BY 12 a.name 13 / Disk Group Name Path File Name Fail Group File Size (MB) Used Size (MB) Pct. Used -------------------- ----------------- -------------------- -------------------- -------------- -------------- --------- DATA1 /dev/sdd DATA1_0000 DATA1_0000 4,096 2,196 53.61 ******************** -------------- -------------- 4,096 2,196 DATA2 /dev/sdb DATA2_0000 DATA2_0000 2,048 104 5.08 ******************** -------------- -------------- 2,048 104 DATA3 /dev/sdc DATA3_0000 DATA3_0000 2,048 160 7.81 ******************** -------------- -------------- 2,048 160 -------------- -------------- Grand Total: 8,192 2,460 |
创建test表空间;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
SQL> create tablespace test datafile '+DATA2' size 20m; Tablespace created. SQL> create tablespace test1 datafile '+DATA3' size 20m; Tablespace created. SQL> SQL> select file_name from dba_data_files; FILE_NAME -------------------------------------------------------------------------------- +DATA1/roger/users01.dbf +DATA1/roger/sysaux01.dbf +DATA1/roger/system01.dbf +DATA1/roger/roger01.dbf +DATA1/roger/undotbs.dbf +DATA2/roger/datafile/test.256.792394777 +DATA3/roger/datafile/test1.256.792394799 7 rows selected. SQL> |
我们可以看到对于这两个磁盘组,datafile对应的asm file number都是从256开始的。
首先我们来看data2 磁盘组上的test表空间datafile的au 分布,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
[ora11g@11gR2test ~]$ kfed read /dev/sdb aun=0 blkn=0|grep f1 kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002 [ora11g@11gR2test ~]$ kfed read /dev/sdb aun=2 blkn=1|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 513 ; 0x004: T=0 NUMB=0x201 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0 kfbh.check: 2948726368 ; 0x00c: 0xafc1fe60 kfbh.fcn.base: 0 ; 0x010: 0x00000000 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 kfdatb10.aunum: 228928 ; 0x000: 0x00037e40 kfdatb10.shrink: 0 ; 0x004: 0x0000 kfdatb10.ub2pad: 12001 ; 0x006: 0x2ee1 kfdatb10.auinfo[0].link.next: 8 ; 0x008: 0x0008 kfdatb10.auinfo[0].link.prev: 8 ; 0x00a: 0x0008 kfdatb10.auinfo[0].free: 0 ; 0x00c: 0x0000 kfdatb10.auinfo[0].total: 0 ; 0x00e: 0x0000 kfdatb10.auinfo[1].link.next: 16 ; 0x010: 0x0010 kfdatb10.auinfo[1].link.prev: 16 ; 0x012: 0x0010 kfdatb10.auinfo[1].free: 0 ; 0x014: 0x0000 kfdatb10.auinfo[1].total: 0 ; 0x016: 0x0000 kfdatb10.auinfo[2].link.next: 24 ; 0x018: 0x0018 kfdatb10.auinfo[2].link.prev: 24 ; 0x01a: 0x0018 kfdatb10.auinfo[2].free: 0 ; 0x01c: 0x0000 kfdatb10.auinfo[2].total: 0 ; 0x01e: 0x0000 kfdatb10.auinfo[3].link.next: 32 ; 0x020: 0x0020 kfdatb10.auinfo[3].link.prev: 32 ; 0x022: 0x0020 kfdatb10.auinfo[3].free: 0 ; 0x024: 0x0000 kfdatb10.auinfo[3].total: 0 ; 0x026: 0x0000 .....省略部分内容 |
这里有点奇怪的是,我们从au 8去定位,发现报错,知道是不是oracle这里有些问题。如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[ora11g@11gR2test ~]$ kfed read /dev/sdb aun=8 blkn=256|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 13 ; 0x002: KFBTYP_PST_NONE kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 2147483904 ; 0x004: T=1 NUMB=0x100 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0 kfbh.check: 17662721 ; 0x00c: 0x010d8301 kfbh.fcn.base: 0 ; 0x010: 0x00000000 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 ERROR!!!, failed to get the oracore error message |
或许是因为我开始也使用了这些AU,然后将其drop,又重建表空间,且分配的空间是一样大。
但是我能够在next的au 里面找到对应的datafile 的au分布情况,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
[ora11g@11gR2test ~]$ kfed read /dev/sdb aun=16 blkn=256|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 4 ; 0x002: KFBTYP_FILEDIR kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 256 ; 0x004: T=0 NUMB=0x100 kfbh.block.obj: 1 ; 0x008: TYPE=0x0 NUMB=0x1 kfbh.check: 1407468159 ; 0x00c: 0x53e4427f kfbh.fcn.base: 19 ; 0x010: 0x00000013 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 kfffdb.node.incarn: 792394777 ; 0x000: A=1 NUMM=0x179d7e0c kfffdb.node.frlist.number: 4294967295 ; 0x004: 0xffffffff kfffdb.node.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0 kfffdb.hibytes: 0 ; 0x00c: 0x00000000 kfffdb.lobytes: 20979712 ; 0x010: 0x01402000 kfffdb.xtntcnt: 3 ; 0x014: 0x00000003 kfffdb.xtnteof: 3 ; 0x018: 0x00000003 kfffdb.blkSize: 8192 ; 0x01c: 0x00002000 kfffdb.flags: 17 ; 0x020: O=1 S=0 S=0 D=0 C=1 I=0 R=0 A=0 kfffdb.fileType: 2 ; 0x021: 0x02 kfffdb.dXrs: 17 ; 0x022: SCHE=0x1 NUMB=0x1 kfffdb.iXrs: 17 ; 0x023: SCHE=0x1 NUMB=0x1 kfffdb.dXsiz[0]: 4294967295 ; 0x024: 0xffffffff kfffdb.dXsiz[1]: 0 ; 0x028: 0x00000000 kfffdb.dXsiz[2]: 0 ; 0x02c: 0x00000000 kfffdb.iXsiz[0]: 4294967295 ; 0x030: 0xffffffff kfffdb.iXsiz[1]: 0 ; 0x034: 0x00000000 kfffdb.iXsiz[2]: 0 ; 0x038: 0x00000000 kfffdb.xtntblk: 3 ; 0x03c: 0x0003 kfffdb.break: 60 ; 0x03e: 0x003c kfffdb.priZn: 0 ; 0x040: KFDZN_COLD kfffdb.secZn: 0 ; 0x041: KFDZN_COLD kfffdb.ub2spare: 0 ; 0x042: 0x0000 kfffdb.alias[0]: 106 ; 0x044: 0x0000006a kfffdb.alias[1]: 4294967295 ; 0x048: 0xffffffff kfffdb.strpwdth: 1 ; 0x04c: 0x01 kfffdb.strpsz: 23 ; 0x04d: 0x17 kfffdb.usmsz: 0 ; 0x04e: 0x0000 kfffdb.crets.hi: 32973669 ; 0x050: HOUR=0x5 DAYS=0x1b MNTH=0x8 YEAR=0x7dc kfffdb.crets.lo: 2655528960 ; 0x054: USEC=0x0 MSEC=0x20a SECS=0x24 MINS=0x27 kfffdb.modts.hi: 32973669 ; 0x058: HOUR=0x5 DAYS=0x1b MNTH=0x8 YEAR=0x7dc kfffdb.modts.lo: 0 ; 0x05c: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0 kfffdb.dasz[0]: 0 ; 0x060: 0x00 .....省略部分信息 kfffdb.spare[10]: 0 ; 0x098: 0x00000000 kfffdb.spare[11]: 0 ; 0x09c: 0x00000000 kfffdb.usm: ; 0x0a0: length=0 kfffde[0].xptr.au: 13 ; 0x4a0: 0x0000000d kfffde[0].xptr.disk: 0 ; 0x4a4: 0x0000 kfffde[0].xptr.flags: 0 ; 0x4a6: L=0 E=0 D=0 S=0 kfffde[0].xptr.chk: 39 ; 0x4a7: 0x27 kfffde[1].xptr.au: 14 ; 0x4a8: 0x0000000e kfffde[1].xptr.disk: 0 ; 0x4ac: 0x0000 kfffde[1].xptr.flags: 0 ; 0x4ae: L=0 E=0 D=0 S=0 kfffde[1].xptr.chk: 36 ; 0x4af: 0x24 kfffde[2].xptr.au: 15 ; 0x4b0: 0x0000000f kfffde[2].xptr.disk: 0 ; 0x4b4: 0x0000 kfffde[2].xptr.flags: 0 ; 0x4b6: L=0 E=0 D=0 S=0 kfffde[2].xptr.chk: 37 ; 0x4b7: 0x25 kfffde[3].xptr.au: 4294967295 ; 0x4b8: 0xffffffff kfffde[3].xptr.disk: 65535 ; 0x4bc: 0xffff kfffde[3].xptr.flags: 0 ; 0x4be: L=0 E=0 D=0 S=0 kfffde[3].xptr.chk: 42 ; 0x4bf: 0x2a |
接着我们再来看看data3 磁盘组上的,test1 表空间datafile的分布情况:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
[ora11g@11gR2test ~]$ kfed read /dev/sdc aun=2 blkn=1|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 513 ; 0x004: T=0 NUMB=0x201 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0 kfbh.check: 2948726368 ; 0x00c: 0xafc1fe60 kfbh.fcn.base: 0 ; 0x010: 0x00000000 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 kfdatb10.aunum: 228928 ; 0x000: 0x00037e40 kfdatb10.shrink: 0 ; 0x004: 0x0000 kfdatb10.ub2pad: 12001 ; 0x006: 0x2ee1 kfdatb10.auinfo[0].link.next: 8 ; 0x008: 0x0008 kfdatb10.auinfo[0].link.prev: 8 ; 0x00a: 0x0008 kfdatb10.auinfo[0].free: 0 ; 0x00c: 0x0000 kfdatb10.auinfo[0].total: 0 ; 0x00e: 0x0000 kfdatb10.auinfo[1].link.next: 16 ; 0x010: 0x0010 kfdatb10.auinfo[1].link.prev: 16 ; 0x012: 0x0010 kfdatb10.auinfo[1].free: 0 ; 0x014: 0x0000 kfdatb10.auinfo[1].total: 0 ; 0x016: 0x0000 kfdatb10.auinfo[2].link.next: 24 ; 0x018: 0x0018 kfdatb10.auinfo[2].link.prev: 24 ; 0x01a: 0x0018 kfdatb10.auinfo[2].free: 0 ; 0x01c: 0x0000 kfdatb10.auinfo[2].total: 0 ; 0x01e: 0x0000 kfdatb10.auinfo[3].link.next: 32 ; 0x020: 0x0020 kfdatb10.auinfo[3].link.prev: 32 ; 0x022: 0x0020 kfdatb10.auinfo[3].free: 0 ; 0x024: 0x0000 kfdatb10.auinfo[3].total: 0 ; 0x026: 0x0000 kfdate[0].discriminator: 1 ; 0x028: 0x00000001 kfdate[0].allo.lo: 0 ; 0x028: XNUM=0x0 kfdate[0].allo.hi: 9437183 ; 0x02c: V=1 I=0 H=0 FNUM=0xfffff kfdate[1].discriminator: 1 ; 0x030: 0x00000001 kfdate[1].allo.lo: 0 ; 0x030: XNUM=0x0 .....省略部分内容 [ora11g@11gR2test ~]$ kfed read /dev/sdc aun=8 blkn=256|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 2304 ; 0x004: T=0 NUMB=0x900 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0 kfbh.check: 2949461921 ; 0x00c: 0xafcd37a1 kfbh.fcn.base: 0 ; 0x010: 0x00000000 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 kfdatb10.aunum: 1031296 ; 0x000: 0x000fbc80 kfdatb10.shrink: 0 ; 0x004: 0x0000 kfdatb10.ub2pad: 12001 ; 0x006: 0x2ee1 kfdatb10.auinfo[0].link.next: 8 ; 0x008: 0x0008 kfdatb10.auinfo[0].link.prev: 8 ; 0x00a: 0x0008 kfdatb10.auinfo[0].free: 0 ; 0x00c: 0x0000 kfdatb10.auinfo[0].total: 0 ; 0x00e: 0x0000 kfdatb10.auinfo[1].link.next: 16 ; 0x010: 0x0010 kfdatb10.auinfo[1].link.prev: 16 ; 0x012: 0x0010 kfdatb10.auinfo[1].free: 0 ; 0x014: 0x0000 kfdatb10.auinfo[1].total: 0 ; 0x016: 0x0000 kfdatb10.auinfo[2].link.next: 24 ; 0x018: 0x0018 kfdatb10.auinfo[2].link.prev: 24 ; 0x01a: 0x0018 kfdatb10.auinfo[2].free: 0 ; 0x01c: 0x0000 kfdatb10.auinfo[2].total: 0 ; 0x01e: 0x0000 kfdatb10.auinfo[3].link.next: 32 ; 0x020: 0x0020 kfdatb10.auinfo[3].link.prev: 32 ; 0x022: 0x0020 kfdatb10.auinfo[3].free: 0 ; 0x024: 0x0000 kfdatb10.auinfo[3].total: 0 ; 0x026: 0x0000 kfdate[0].discriminator: 1 ; 0x028: 0x00000001 kfdate[0].allo.lo: 0 ; 0x028: XNUM=0x0 ....省略部分内容 [ora11g@11gR2test ~]$ kfed read /dev/sdc aun=32 blkn=256|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 4 ; 0x002: KFBTYP_FILEDIR kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 256 ; 0x004: T=0 NUMB=0x100 kfbh.block.obj: 1 ; 0x008: TYPE=0x0 NUMB=0x1 kfbh.check: 2699974988 ; 0x00c: 0xa0ee594c kfbh.fcn.base: 26 ; 0x010: 0x0000001a kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 kfffdb.node.incarn: 792394799 ; 0x000: A=1 NUMM=0x179d7e17 kfffdb.node.frlist.number: 4294967295 ; 0x004: 0xffffffff kfffdb.node.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0 kfffdb.hibytes: 0 ; 0x00c: 0x00000000 kfffdb.lobytes: 20979712 ; 0x010: 0x01402000 kfffdb.xtntcnt: 2 ; 0x014: 0x00000002 kfffdb.xtnteof: 2 ; 0x018: 0x00000002 kfffdb.blkSize: 8192 ; 0x01c: 0x00002000 kfffdb.flags: 17 ; 0x020: O=1 S=0 S=0 D=0 C=1 I=0 R=0 A=0 kfffdb.fileType: 2 ; 0x021: 0x02 kfffdb.dXrs: 17 ; 0x022: SCHE=0x1 NUMB=0x1 kfffdb.iXrs: 17 ; 0x023: SCHE=0x1 NUMB=0x1 kfffdb.dXsiz[0]: 4294967295 ; 0x024: 0xffffffff kfffdb.dXsiz[1]: 0 ; 0x028: 0x00000000 kfffdb.dXsiz[2]: 0 ; 0x02c: 0x00000000 kfffdb.iXsiz[0]: 4294967295 ; 0x030: 0xffffffff kfffdb.iXsiz[1]: 0 ; 0x034: 0x00000000 kfffdb.iXsiz[2]: 0 ; 0x038: 0x00000000 kfffdb.xtntblk: 2 ; 0x03c: 0x0002 kfffdb.break: 60 ; 0x03e: 0x003c kfffdb.priZn: 0 ; 0x040: KFDZN_COLD kfffdb.secZn: 0 ; 0x041: KFDZN_COLD kfffdb.ub2spare: 0 ; 0x042: 0x0000 kfffdb.alias[0]: 106 ; 0x044: 0x0000006a kfffdb.alias[1]: 4294967295 ; 0x048: 0xffffffff kfffdb.strpwdth: 1 ; 0x04c: 0x01 kfffdb.strpsz: 24 ; 0x04d: 0x18 kfffdb.usmsz: 0 ; 0x04e: 0x0000 kfffdb.crets.hi: 32973669 ; 0x050: HOUR=0x5 DAYS=0x1b MNTH=0x8 YEAR=0x7dc kfffdb.crets.lo: 2679979008 ; 0x054: USEC=0x0 MSEC=0x34f SECS=0x3b MINS=0x27 kfffdb.modts.hi: 32973669 ; 0x058: HOUR=0x5 DAYS=0x1b MNTH=0x8 YEAR=0x7dc kfffdb.modts.lo: 0 ; 0x05c: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0 kfffdb.dasz[0]: 0 ; 0x060: 0x00 .....省略部分内容 kfffdb.spare[11]: 0 ; 0x09c: 0x00000000 kfffdb.usm: ; 0x0a0: length=0 kfffde[0].xptr.au: 10 ; 0x4a0: 0x0000000a kfffde[0].xptr.disk: 0 ; 0x4a4: 0x0000 kfffde[0].xptr.flags: 0 ; 0x4a6: L=0 E=0 D=0 S=0 kfffde[0].xptr.chk: 32 ; 0x4a7: 0x20 kfffde[1].xptr.au: 11 ; 0x4a8: 0x0000000b kfffde[1].xptr.disk: 0 ; 0x4ac: 0x0000 kfffde[1].xptr.flags: 0 ; 0x4ae: L=0 E=0 D=0 S=0 kfffde[1].xptr.chk: 33 ; 0x4af: 0x21 kfffde[2].xptr.au: 4294967295 ; 0x4b0: 0xffffffff kfffde[2].xptr.disk: 65535 ; 0x4b4: 0xffff kfffde[2].xptr.flags: 0 ; 0x4b6: L=0 E=0 D=0 S=0 kfffde[2].xptr.chk: 42 ; 0x4b7: 0x2a kfffde[3].xptr.au: 4294967295 ; 0x4b8: 0xffffffff |
下面我们来查下x$表,看au的分布查询对否:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
SQL> select disk_kffxp, AU_kffxp, xnum_kffxp 2 from x$kffxp 3 where group_kffxp = 2 4 and number_kffxp = 256; DISK_KFFXP AU_KFFXP XNUM_KFFXP ---------- ---------- ---------- 0 13 0 0 14 1 0 15 2 SQL> select disk_kffxp, AU_kffxp, xnum_kffxp 2 from x$kffxp 3 where group_kffxp = 3 4 and number_kffxp = 256; DISK_KFFXP AU_KFFXP XNUM_KFFXP ---------- ---------- ---------- 0 10 0 0 11 1 |
可以看到,我们前面kfed的操作是正常的,test 表空间占据13,14,15 一共3个AU,每个au为8m。
test1表空间一个占据2个AU,每个au大小是16m。
这里要说明一下:asm这里都是以au分配为单位,也就是说最小分配都是一个AU,换句话说也就是AU的整数倍,
我前面的datafile都是20m,所以针对8m和16m的AU SIZE来讲,分配需要分配3个和2个。
下面我们将test 表空间的datafileresize一下,来看一个有趣的事情:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
SQL> l 1* select file_id,file_name,tablespace_name from dba_data_files order by 1 SQL> / FILE_ID FILE_NAME TABLESPACE_NAME ---------- ------------------------------------------------------------ --------------- 1 +DATA1/roger/system01.dbf SYSTEM 2 +DATA1/roger/sysaux01.dbf SYSAUX 3 +DATA2/roger/datafile/test.256.792394777 TEST 4 +DATA1/roger/users01.dbf USERS 5 +DATA1/roger/roger01.dbf ROGER 6 +DATA1/roger/undotbs.dbf UNDOTBS 7 +DATA3/roger/datafile/test1.256.792394799 TEST1 7 rows selected. SQL> alter database datafile 3 resize 30m; Database altered. SQL> [ora11g@11gR2test db]$ kfed read /dev/sdb aun=16 blkn=256|more kfbh.endian: 1 ; 0x000: 0x01 kfbh.hard: 130 ; 0x001: 0x82 kfbh.type: 4 ; 0x002: KFBTYP_FILEDIR kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.block.blk: 256 ; 0x004: T=0 NUMB=0x100 kfbh.block.obj: 1 ; 0x008: TYPE=0x0 NUMB=0x1 kfbh.check: 3166388824 ; 0x00c: 0xbcbb4258 kfbh.fcn.base: 32 ; 0x010: 0x00000020 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000 kfffdb.node.incarn: 792394777 ; 0x000: A=1 NUMM=0x179d7e0c kfffdb.node.frlist.number: 4294967295 ; 0x004: 0xffffffff kfffdb.node.frlist.incarn: 0 ; 0x008: A=0 NUMM=0x0 kfffdb.hibytes: 0 ; 0x00c: 0x00000000 kfffdb.lobytes: 31465472 ; 0x010: 0x01e02000 kfffdb.xtntcnt: 4 ; 0x014: 0x00000004 kfffdb.xtnteof: 4 ; 0x018: 0x00000004 kfffdb.blkSize: 8192 ; 0x01c: 0x00002000 kfffdb.flags: 17 ; 0x020: O=1 S=0 S=0 D=0 C=1 I=0 R=0 A=0 kfffdb.fileType: 2 ; 0x021: 0x02 kfffdb.dXrs: 17 ; 0x022: SCHE=0x1 NUMB=0x1 kfffdb.iXrs: 17 ; 0x023: SCHE=0x1 NUMB=0x1 kfffdb.dXsiz[0]: 4294967295 ; 0x024: 0xffffffff kfffdb.dXsiz[1]: 0 ; 0x028: 0x00000000 kfffdb.dXsiz[2]: 0 ; 0x02c: 0x00000000 kfffdb.iXsiz[0]: 4294967295 ; 0x030: 0xffffffff kfffdb.iXsiz[1]: 0 ; 0x034: 0x00000000 kfffdb.iXsiz[2]: 0 ; 0x038: 0x00000000 kfffdb.xtntblk: 4 ; 0x03c: 0x0004 kfffdb.break: 60 ; 0x03e: 0x003c kfffdb.priZn: 0 ; 0x040: KFDZN_COLD kfffdb.secZn: 0 ; 0x041: KFDZN_COLD kfffdb.ub2spare: 0 ; 0x042: 0x0000 kfffdb.alias[0]: 106 ; 0x044: 0x0000006a kfffdb.alias[1]: 4294967295 ; 0x048: 0xffffffff kfffdb.strpwdth: 1 ; 0x04c: 0x01 kfffdb.strpsz: 23 ; 0x04d: 0x17 kfffdb.usmsz: 0 ; 0x04e: 0x0000 kfffdb.crets.hi: 32973669 ; 0x050: HOUR=0x5 DAYS=0x1b MNTH=0x8 YEAR=0x7dc kfffdb.crets.lo: 2655528960 ; 0x054: USEC=0x0 MSEC=0x20a SECS=0x24 MINS=0x27 kfffdb.modts.hi: 32973670 ; 0x058: HOUR=0x6 DAYS=0x1b MNTH=0x8 YEAR=0x7dc kfffdb.modts.lo: 0 ; 0x05c: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0 kfffdb.dasz[0]: 0 ; 0x060: 0x00 .....省略部分信息 kfffdb.usm: ; 0x0a0: length=0 kfffde[0].xptr.au: 13 ; 0x4a0: 0x0000000d kfffde[0].xptr.disk: 0 ; 0x4a4: 0x0000 kfffde[0].xptr.flags: 0 ; 0x4a6: L=0 E=0 D=0 S=0 kfffde[0].xptr.chk: 39 ; 0x4a7: 0x27 kfffde[1].xptr.au: 14 ; 0x4a8: 0x0000000e kfffde[1].xptr.disk: 0 ; 0x4ac: 0x0000 kfffde[1].xptr.flags: 0 ; 0x4ae: L=0 E=0 D=0 S=0 kfffde[1].xptr.chk: 36 ; 0x4af: 0x24 kfffde[2].xptr.au: 15 ; 0x4b0: 0x0000000f kfffde[2].xptr.disk: 0 ; 0x4b4: 0x0000 kfffde[2].xptr.flags: 0 ; 0x4b6: L=0 E=0 D=0 S=0 kfffde[2].xptr.chk: 37 ; 0x4b7: 0x25 kfffde[3].xptr.au: 16 ; 0x4b8: 0x00000010 kfffde[3].xptr.disk: 0 ; 0x4bc: 0x0000 kfffde[3].xptr.flags: 0 ; 0x4be: L=0 E=0 D=0 S=0 kfffde[3].xptr.chk: 58 ; 0x4bf: 0x3a kfffde[4].xptr.au: 4294967295 ; 0x4c0: 0xffffffff kfffde[4].xptr.disk: 65535 ; 0x4c4: 0xffff kfffde[4].xptr.flags: 0 ; 0x4c6: L=0 E=0 D=0 S=0 |
我们可以看到,这里oracle仅仅是增加了一个AU,开始我们是20m,au为8m,所以oracle应该分配3个,
或许有人会说,这里又增加了10m,那么oracle应该再分配2个au才对啊。 你可以看到oracle这里并不
是这样的,可见其是多么的聪明!
3 Responses to “Oracle 11g asm中不同au size下datafile的au分布初探”
我等只能仰望了~
过了多久就能超老盖了
爱研究的人,牛
Leave a Reply
You must be logged in to post a comment.