# ASM Translation Series 20: ASM Internal ASM file number 7

Keywords: Attribute Database SQL

Original text: ASM file number 7
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

ASM Meta Information 7 is the logical volume directory of ASM, which is used to track files related to ADVM.

ASM Dynamic Logic Volume Device is constructed by ASM Dynamic Logic Volume. One or more ASM dynamic logical volume devices can be configured in a disk group. ASM cluster file system is built on ASM disk group through ADVM interface. Like a database, ADVM is also a client of ASM. When a logical volume is accessed, the corresponding ASM file is opened and the ASM extension information is sent to the ADVM driver.

There are two file types associated with ADVM logical volumes:

  • ASMVOL: Logical Volume Files as Containers for Logical Volume Storage
  • ASMVDRL: A file containing information about the area of dirty data records. This file is used when resynchronizing mirror data.

Turn up the ADVM volume

It is not necessary to create a separate disk group for ADVM, but it does make sense to do so by isolating database files from ACFS files. Look at a few examples.

SQL> create diskgroup ACFS
disk 'ORCL:ASMDISK5', 'ORCL:ASMDISK6'
attribute 'COMPATIBLE.ASM' = '11.2', 'COMPATIBLE.ADVM' = '11.2';
Diskgroup created.

To create logical volumes, you first need to have a disk group on which you create a disk group called acfs. In order to create logical volumes in disk groups, COMPATIBLE.ASM and COMPATIBLE.ADVM of disk groups must be set to 11.2 or more, and ADVM/ACFS drivers must be loaded (in cluster environments, they are loaded by default, while in single instance environments, they need to be loaded manually).

With the above requirements, you can create logical volumes in the disk group.

$ asmcmd volcreate -G ACFS -s 2G ACFS_VOL1

$ asmcmd volcreate -G ACFS -s 2G ACFS_VOL2

$ asmcmd volinfo -a
Diskgroup Name: ACFS

 Volume Name: ACFS_VOL1
 Volume Device: /dev/asm/acfs_vol1-159
 State: ENABLED
 Size (MB): 2048
 Resize Unit (MB): 32
 Redundancy: MIRROR
 Stripe Columns: 4
 Stripe Width (K): 128
 Usage:
 Mountpath:

 Volume Name: ACFS_VOL2
 Volume Device: /dev/asm/acfs_vol2-159
 State: ENABLED
 Size (MB): 2048
 Resize Unit (MB): 32
 Redundancy: MIRROR
 Stripe Columns: 4
 Stripe Width (K): 128
 Usage:
 Mountpath:

$

Up to now, there are no corresponding mount directories associated with logical volumes, so they can not be used. At this point, we can first look at the ADVM logical volume element information, we first get the allocation unit from the logical volume directory.

SQL> SELECT x.xnum_kffxp "Extent",
 x.au_kffxp "AU",
 x.disk_kffxp "Disk #",
 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 x.group_kffxp=2
 and x.number_kffxp=7
ORDER BY 1, 2;

    Extent         AU     Disk # Disk name
---------- ---------- ---------- ------------------------------
         0         53          1 ASMDISK6
         0         53          0 ASMDISK5

Next, use the kfed tool to view the real meta-information.

$ kfed read /dev/oracleasm/disks/ASMDISK5 aun=53 | more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                           22 ; 0x002: KFBTYP_VOLUMEDIR
...
kfvvde.entry.incarn:                  1 ; 0x024: A=1 NUMM=0x0
kfvvde.entry.hash:                    0 ; 0x028: 0x00000000
kfvvde.entry.refer.number:   4294967295 ; 0x02c: 0xffffffff
kfvvde.entry.refer.incarn:            0 ; 0x030: A=0 NUMM=0x0
kfvvde.volnm:           ++AVD_DG_NUMBER ; 0x034: length=15
kfvvde.usage:                           ; 0x054: length=0
kfvvde.dgname:                          ; 0x074: length=0
kfvvde.clname:                          ; 0x094: length=0
kfvvde.mountpath:                       ; 0x0b4: length=0
kfvvde.drlinit:                       0 ; 0x4b5: 0x00
kfvvde.pad1:                          0 ; 0x4b6: 0x0000
kfvvde.volfnum.number:                0 ; 0x4b8: 0x00000000
kfvvde.volfnum.incarn:                0 ; 0x4bc: 0x00000000
kfvvde.drlfnum.number:                0 ; 0x4c0: 0x00000000
kfvvde.drlfnum.incarn:                0 ; 0x4c4: 0x00000000
kfvvde.volnum:                        0 ; 0x4c8: 0x0000
kfvvde.avddgnum:                    159 ; 0x4ca: 0x009f
kfvvde.extentsz:                      0 ; 0x4cc: 0x00000000
kfvvde.volstate:                      4 ; 0x4d0: D=0 C=0 R=1
...

The output information above shows block 0 of AU 53. It only contains the label of ADVM logical volume (++ AVD_DG_NUMBER), and the real information of logical volume is actually located in block 1 and later.

$ kfed read /dev/oracleasm/disks/ASMDISK5 aun=53 blkn=1 | more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                           22 ; 0x002: KFBTYP_VOLUMEDIR
...
kfvvde.entry.incarn:                  1 ; 0x024: A=1 NUMM=0x0
kfvvde.entry.hash:                    0 ; 0x028: 0x00000000
kfvvde.entry.refer.number:   4294967295 ; 0x02c: 0xffffffff
kfvvde.entry.refer.incarn:            0 ; 0x030: A=0 NUMM=0x0
kfvvde.volnm:                 ACFS_VOL1 ; 0x034: length=9
kfvvde.usage:                           ; 0x054: length=0
kfvvde.dgname:                          ; 0x074: length=0
kfvvde.clname:                          ; 0x094: length=0
kfvvde.mountpath:                       ; 0x0b4: length=0
kfvvde.drlinit:                       0 ; 0x4b5: 0x00
kfvvde.pad1:                          0 ; 0x4b6: 0x0000
kfvvde.volfnum.number:              257 ; 0x4b8: 0x00000101
kfvvde.volfnum.incarn:        771971291 ; 0x4bc: 0x2e0358db
kfvvde.drlfnum.number:              256 ; 0x4c0: 0x00000100
kfvvde.drlfnum.incarn:        771971289 ; 0x4c4: 0x2e0358d9
kfvvde.volnum:                        1 ; 0x4c8: 0x0001
kfvvde.avddgnum:                    159 ; 0x4ca: 0x009f
kfvvde.extentsz:                      8 ; 0x4cc: 0x00000008
kfvvde.volstate:                      2 ; 0x4d0: D=0 C=1 R=0
...

$ kfed read /dev/oracleasm/disks/ASMDISK5 aun=53 blkn=2 | more
kfbh.endian:                          1 ; 0x000: 0x01
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                           22 ; 0x002: KFBTYP_VOLUMEDIR
...
kfvvde.entry.incarn:                  1 ; 0x024: A=1 NUMM=0x0
kfvvde.entry.hash:                    0 ; 0x028: 0x00000000
kfvvde.entry.refer.number:   4294967295 ; 0x02c: 0xffffffff
kfvvde.entry.refer.incarn:            0 ; 0x030: A=0 NUMM=0x0
kfvvde.volnm:                 ACFS_VOL2 ; 0x034: length=9
kfvvde.usage:                           ; 0x054: length=0
kfvvde.dgname:                          ; 0x074: length=0
kfvvde.clname:                          ; 0x094: length=0
kfvvde.mountpath:                       ; 0x0b4: length=0
kfvvde.drlinit:                       0 ; 0x4b5: 0x00
kfvvde.pad1:                          0 ; 0x4b6: 0x0000
kfvvde.volfnum.number:              259 ; 0x4b8: 0x00000103
kfvvde.volfnum.incarn:        771971303 ; 0x4bc: 0x2e0358e7
kfvvde.drlfnum.number:              258 ; 0x4c0: 0x00000102
kfvvde.drlfnum.incarn:        771971301 ; 0x4c4: 0x2e0358e5
kfvvde.volnum:                        2 ; 0x4c8: 0x0002
kfvvde.avddgnum:                    159 ; 0x4ca: 0x009f
kfvvde.extentsz:                      8 ; 0x4cc: 0x00000008
kfvvde.volstate:                      2 ; 0x4d0: D=0 C=1 R=0
...

The ASM meta-information 7 file block 1 contains the information of the first logical volume (kfvvde.volnm: ACFS_VOL1), and two files are associated with the logical volume.

  • DRL Dirty Data Recording Area File (kfvde.drlfnum.number: 256)
  • Logical Volume File (kfvvde.volfnum.number: 257)

Blo2 contains information about the second logical volume (kfvvde.volnm: ACFS_VOL2), and two files are associated with the logical volume.

  • DRL Dirty Data Recording Area File (kfvde.drlfnum.number: 258)
  • Logical Volume File (kfvvde.volfnum.number: 259)

These are special files, so they are not displayed in the output of the asmcmd ls command and in the v$asm_alias view. But you can find them in v$asm_file.

SQL> SELECT file_number "File #", bytes/1024/1024 "Size (MB)", type
FROM v$asm_file
WHERE group_number=2;

    File #  Size (MB) TYPE
---------- ---------- ----------
       256         17 ASMVDRL
       257       2048 ASMVOL
       258         17 ASMVDRL
       259       2048 ASMVOL

Create ASM cluster file system

At this point, the ASM Cluster File System (ACFS) can be created on the logical volume device.

# /sbin/mkfs -t acfs /dev/asm/acfs_vol1-159
mkfs.acfs: version                   = 11.2.0.3.0
mkfs.acfs: on-disk version           = 39.0
mkfs.acfs: volume                    = /dev/asm/acfs_vol1-159
mkfs.acfs: volume size               = 2147483648
mkfs.acfs: Format complete.

# mkdir /acfs1

# mount -t acfs /dev/asm/acfs_vol1-159 /acfs1

# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
...
oracleasmfs on /dev/oracleasm type oracleasmfs (rw)
/dev/asm/acfs_vol1-159 on /acfs1 type acfs (rw)

$ asmcmd volinfo -G ACFS ACFS_VOL1
Diskgroup Name: ACFS

 Volume Name: ACFS_VOL1
 Volume Device: /dev/asm/acfs_vol1-159
 State: ENABLED
 Size (MB): 2048
 Resize Unit (MB): 32
 Redundancy: MIRROR
 Stripe Columns: 4
 Stripe Width (K): 128
 Usage: ACFS
 Mountpath: /acfs1

$

Let's see if the Logical Volume Directory contains a mount directory:

$ kfed read /dev/oracleasm/disks/ASMDISK6 aun=53 blkn=1 | grep mountpath
kfvvde.mountpath:                /acfs1 ; 0x0b4: length=6

Such is the case.

Conclusion

One or more ASM dynamic logical volume devices can be configured in a disk group. ASM cluster file system is built on ASM disk group through ADVM interface. ADVM, like database, is also a client of ASM.

There are two file types associated with ADVM logical volumes:

  • ASMVOL: Logical Volume Files as Containers for Logical Volume Storage Devices
  • ASMVDRL: A file containing information about the area of dirty data records. This file is used to restore mirror data.

Posted by Smiffy on Sat, 22 Dec 2018 10:27:05 -0800