Original text: ASM file number 9
Author: Bane Radulovic
Translator: Guo Xurui, Warbury Technology Product Delivery Manager, is responsible for the overall delivery management, technical support and maintenance services of QData Cloud high-performance database cloud platform, QBackup database second-level backup recovery cloud platform and other products.
Revision: Wei Xinghua
Editorial Responsibility: Zhong Peiyi
The metadata 9 file of ASM is the ASM attribute directory, which contains the attribute information of the disk group. Property directories exist only if the compatible.asm property of the disk group is set to 11.1 or more.
It was not until ASM version 11.1 that the concept of disk group attributes was introduced, which was used to fine-grained adjustments to disk group attributes. Some attributes can only be specified when a disk group is created (such as au_size), and some attributes can be specified at any time (such as disk_repair_time). Some attributes are stored in the disk head (such as au_size), and some attributes are stored in the [membership and status table] or in the disk head, depending on the ASM version.
Translator's Note: For information on membership and status tables, partnerships and status tables, refer to the details in this series.
Public attributes
Most properties are stored in the properties directory and can be obtained by querying the v$asm_attribute view. We look at the properties of all my disk groups by querying this view:
SQL> SELECT g.name "Group", a.name "Attribute", a.value "Value"
FROM v$asm_diskgroup g, v$asm_attribute a
WHERE g.group_number=a.group_number and a.name not like 'template%';
Group Attribute Value
----- ----------------------- ----------------
ACFS disk_repair_time 3.6h
au_size 1048576
access_control.umask 026
access_control.enabled TRUE
cell.smart_scan_capable FALSE
compatible.advm 11.2.0.0.0
compatible.rdbms 11.2
compatible.asm 11.2.0.0.0
sector_size 512
DATA access_control.enabled TRUE
cell.smart_scan_capable FALSE
compatible.rdbms 11.2
compatible.asm 11.2.0.0.0
sector_size 512
au_size 1048576
disk_repair_time 3.6h
access_control.umask 026
SQL>
One property that we can modify at any time is disk repair time. The following commands modify the DATA disk group through asmcmd:
$ asmcmd setattr -G DATA disk_repair_time '8.0h'
$ asmcmd lsattr -lm disk_repair_time
Group_Name Name Value RO Sys
ACFS disk_repair_time 3.6h N Y
DATA disk_repair_time 8.0h N Y
$
Hidden attributes
As mentioned earlier, the property directory is located in the ASM Metadata 9 file. Now we locate the properties directory of disk group 2.
SQL> SELECT x.disk_kffxp "Disk#",
x.xnum_kffxp "Extent",
x.au_kffxp "AU",
d.name "Disk name"
FROM x$kffxp x, v$asm_disk_stat d
WHERE x.group_kffxp=d.group_number
and x.disk_kffxp=d.disk_number
and d.group_number=2
and x.number_kffxp=9
ORDER BY 1, 2;
Disk# Extent AU Disk name
----- ------ ---- ---------
0 0 1146 ASMDISK1
1 0 1143 ASMDISK2
2 0 1150 ASMDISK3
SQL>
Now use the kfed tool for viewing.
$ kfed read /dev/oracleasm/disks/ASMDISK3 aun=1150 | more
kfbh.endian: 1 ; 0x000: 0x01
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 23 ; 0x002: KFBTYP_ATTRDIR
...
kfede[0].entry.incarn: 1 ; 0x024: A=1 NUMM=0x0
kfede[0].entry.hash: 0 ; 0x028: 0x00000000
kfede[0].entry.refer.number: 4294967295 ; 0x02c: 0xffffffff
kfede[0].entry.refer.incarn: 0 ; 0x030: A=0 NUMM=0x0
kfede[0].name: disk_repair_time ; 0x034: length=16
kfede[0].value: 8.0h ; 0x074: length=4
...
The kfede[i] field contains the name and value of the disk group property. We combine the egrep command to see the attribute values of all ASM disk groups:
$ kfed read /dev/oracleasm/disks/ASMDISK3 aun=1150 | egrep "name|value"
kfede[0].name: disk_repair_time ; 0x034: length=16
kfede[0].value: 8.0h ; 0x074: length=4
kfede[1].name: _rebalance_compact ; 0x1a8: length=18
kfede[1].value: TRUE ; 0x1e8: length=4
kfede[2].name: _extent_sizes ; 0x31c: length=13
kfede[2].value: 1 4 16 ; 0x35c: length=6
kfede[3].name: _extent_counts ; 0x490: length=14
kfede[3].value: 20000 20000 214748367 ; 0x4d0: length=21
kfede[4].name: _ ; 0x604: length=1
kfede[4].value: 0 ; 0x644: length=1
kfede[5].name: au_size ; 0x778: length=7
kfede[5].value: ; 0x7b8: length=9
kfede[6].name: sector_size ; 0x8ec: length=11
kfede[6].value: ; 0x92c: length=9
kfede[7].name: compatible ; 0xa60: length=10
kfede[7].value: ; 0xaa0: length=9
kfede[8].name: cell ; 0xbd4: length=4
kfede[8].value: FALSE ; 0xc14: length=5
kfede[9].name: access_control ; 0xd48: length=14
kfede[9].value: FALSE ; 0xd88: length=5
Above all, we have also peeked into many hidden disk group attributes. We see that the _REBALANCE_COMPACT attribute is TRUE. This property relates to the compact link in the rebalance of the disk group. We can also see how extents grow (_EXTENT_SIZES), with initialization sizes ranging from one AU to four AUs to 16 AUs. _ EXTENT_COUNTS represents the breakpoint of extension growth. The first 20,000 extents contain only one AU, the next 20,000 extents contain four AUs, and the next extents contain 16 AUs.
Conclusion
Each disk group has some properties of the disk group, which is used to control the characteristics of the disk group in fine granularity. Most properties are stored in the properties directory and can be obtained by querying the v$asm_attribute view.
[1] In the version before ASM 11.1, we can also specify the size of AU when creating the disk group. This is achieved through the ASM implicit parameter _ASM_AUSIZE. In the version after ASM 11.1, because of the appearance of ASM disk group attributes, we can achieve the same purpose by setting the AU_SIZE attribute value of the ASM disk group.