return Sign in

ASM translation series eighth bombs: Internal ASM file extent map ASM

readTwo thousand seven hundred and seventy-two

ASM series introduction:

When ASM creates a file, such as a database instance, it is required to create a data file, it will allocate space in extent. Once the file is created, ASM will pass the extent mapping table to the database instance, and subsequent database instances can access the file without interacting with the ASM instance. If a file's extent needs to be re located, such as the disk group for rebalance operation, ASM will inform the database instance about the extent mapping table changes.

You can query through the ASM instanceX$KFFXPView to obtain the contents of the extent file ASM mapping table. Each row in the X$KFFXP view corresponds to the information on each physical extent of all the files in the mount state disk group.

Translator's note: 1) network has many view on X$KFFXP interpretation. Some of the information is too old, need to point out, it records each record represents is physical extents of information, rather than AU information, view X$KFFXP size SIZE_KFFXP field, on behalf of the the extents is composed of a few Au, after the opening of the characteristics of changeable 11g extents will appear. SIZE_KFFXP than 1, more specific information refer to the first article in this series. 2) X$KFFXP here translated into X$KFFXP view, just for easy to understand, it is a memory of the nature of the data structure (table fixed), the data is not in the buffer_cache.

X$KFFXPImportant fields of view include:

  • GROUP_KFFXPDisk group number. Note that the disk group number is not permanent, and each time the disk group is mount may not be the same. Equivalent toV$ASM_DISKGROUP.GROUP_NUMBERField.
  • NUMBER_KFFXPFile number. Equivalent toV$ASM_FILE.FILE_NUMBERField. Note that the file number of ASM is different from the number of data files in the database. Do not confuse the two concepts. Less than 256 of the ASM file serial number is reserved for the use of ASM metadata files.
  • INCARN_KFFXPFile version number. When a ASM file number is reused by a new file, the file version number will change. Equivalent toV$ASM_FILE.INCARNATIONField. Note that the ASM file is the end of the file number.
  • XNUM_KFFXPVirtual extent serial number. The virtual extent serial number of the redundant disk group of external is consistent with the physical extent number. The virtual extent serial number of the redundant disk group of normal is obtained by the physical extent number in addition to the 2.highThe virtual extent serial number of the redundant disk group is obtained by the physical extent number in addition to the 3.
  • PXN_KFFXPPhysical extent serial number. The physical extent number of a file is beginning with the number 0.
  • LXN_KFFXPThe serial number of physical extent in virtual extent. 0Extent primary, 1 forExtent secondary, 2 forCopy of the extent third.
  • DISK_KFFXPPhysical disk serial number. Equivalent toV$ASM_DISK.DISK_NUMBER.
  • AU AU_KFFXPSerial number. Disk dimension AU number, starting with 0 for each disk.

In the ASM instance through the following query, can be seen within the disk group 3 ASM metadata file file serial number, name and AU number.

$sqlplus / sysasm as
Five,'TemplateDirectory',Six,'AliasDirectory',Seven,'ADVM FileDirectory',Eight,'DiskSpace directory'free,
Two hundred and fifty-three,'spfile ForInstance'ASM,Two hundred and fifty-four,'Stale Bit MapRegistry space',Two hundred and fifty-five,'OracleRepository Registry'Cluster)"Metadata file name ASM",
Count (AU_KFFXP)"Units Allocation"
X$KFFXP from
GROUP_KFFXP= whereThree AndNUMBER_KFFXP<Two hundred and fifty-six
By orderOne;

ASMFileASM metadata numberFileAllocation nameUnits
              One FileDirectoryThree
              TwoDirectory DiskThree
              ThreeChange directory ActiveSixty-nine
              FourOperations directory ContinuingSix
              FiveDirectory TemplateThree
              Six AliasDirectoryThree
              EightFree space directory DiskThree
              NineDirectory AttributesThree
             TwelveDirectory StalenessThree
            Two hundred and fifty-threeSPFILEForInstance ASMTwo
            Two hundred and fifty-fourStaleBit MapRegistry spaceThree
            Two hundred and fifty-fiveCluster Repository registry OracleOne hundred and thirty-five

TwelveSelected. rows

Through the above query results can be found, this disk group does not contain all types of metadata files (such as tenth and eleventh file). An interesting thing is that, in addition to the ASM instance of SPFILE, each file occupies at least 3 AU, for this point more detail we will introduce in other chapters.

We'll come back with a database control file as an example to see its extent mapping table.

The first step, find all the database control files within the DATA disk group (in the Grid OS user identity to run the asmcmd command)

$find asmcmd-TypeControlfile+DATA "*"

In the second step, check the disk group number in the DATA disk group (attached to the ASM instance)

$sqlplus / sysasm as



The third step, check the disk group 1 in the ASM 256 file (+DATA/DBM/CONTROLFILE/Current.256.738247649) extent mapping table

Select XNUM_KFFXP SQL>"Extent Virtual", PXN_KFFXP"Extent Physical", LXN_KFFXP"Copy Extent", DISK_KFFXP"Disk", AU_KFFXP"Unit Allocation"
X$KFFXP from
GROUP_KFFXP= whereOneNUMBER_KFFXP= andTwo hundred and fifty-sixXNUM_KFFXP<> andTwo billion one hundred and forty-seven million four hundred and eighty-three thousand six hundred and forty-eight
By orderOne,Two;

Extent Physical extent Extent Virtual copy Disk Allocation unit
             Zero               Zero           Zero         Twenty               Five
             Zero               One           One         Twenty-nine            One thousand nine hundred and three
             Zero               Two           Two          Six              Eighty-two
             One               Three           Zero         Twenty-two               Six
             One               Four           One         Thirty-one               Eight
             One               Five           Two          Nine               Three
             Two               Six           Zero         Thirty               Eight
             Two               Seven           One         Twenty-three            One thousand nine hundred and seven
             Two               Eight           Two          Seven              Sixty-three
             Three               Nine           Zero         Twenty-six               Two
             Three              Ten           One         Sixteen            One thousand nine hundred and four
             Three              Eleven           Two          Six               Four
            Thirty-nine             One hundred and seventeen           Zero         Twenty-five            One thousand nine hundred and thirteen
            Thirty-nine             One hundred and eighteen           One         Fifteen            One thousand nine hundred and six
            Thirty-nine             One hundred and nineteen           Two          Three              Twenty-seven

One hundred and twentySelected. rows


The above output can be seen that the control file is a three mirror image, each virtual extent corresponding to three physical extent, you can also see the file each AU of the actual location.

Original text: Many partners How
Author:Radulovic Bane
translator:Zhuang Peipei, wo interested in science and technology database pre sales engineer, is responsible for the database platform architecture design, product verification test.
:Wei Xinghua
Commissioning editor:Qian Shuguang