mkdg

Purpose

Creates a disk group based on an XML configuration file.

Syntax and Description

mkdg { config_file.xml | 'contents_of_xml_file' }

Table 10-54 lists the syntax options for the mkdg command.


Table 10-54 Options for the mkdg command

Option Description

config_file

Name of the XML file that contains the configuration for the new disk group. mkdg searches for the XML file in the directory where ASMCMD was started unless a path is specified.

For examples of the valid tags and XML configuration file, see Example 10-63 and Example 10-64.

contents_of_xml_file

The XML script enclosed in single quotations.


mkdg creates a new disk group with an XML configuration file that specifies the name of the disk group, redundancy, attributes, and paths of the disks that form the disk group. Redundancy is an optional parameter; the default is normal redundancy. For some types of redundancy, disks are required to be gathered into failure groups. In the case that failure groups are not specified for a disk group, each disk in the disk group belongs to its own failure group.

The mkdg command only mounts a disk group on the local node.

It is possible to set some disk group attribute values during disk group creation. Some attributes, such as AU_SIZE and SECTOR_SIZE, can be set only during disk group creation. For more information about disk groups attributes, refer to "Managing Disk Group Attributes".

The default disk group compatibility settings are 10.1 for Oracle ASM compatibility, 10.1 for database compatibility, and no value for Oracle ADVM compatibility. For information about disk group compatibility attributes, see "Disk Group Compatibility".

Example 10-63 shows the basic structure and the valid tags with their respective attributes for the mkdg XML configuration file.

Example 10-63 Tags for mkdg XML configuration file

<dg>  disk group
      name         disk group name
      redundancy   normal, external, high
 
<fg>  failure group
      name         failure group name
</fg>

<dsk> disk
      name         disk name
      string       disk path
      size         size of the disk to add
      force        true specifies to use the force option
</dsk>

<a>   attribute
      name         attribute name
      value        attribute value
</a>

</dg>

For information about altering a disk group with ASMCMD chdg, see "chdg". For information about creating a disk group, see "Creating Disk Groups".

Example

The following is an example of an XML configuration file for mkdg. The configuration file creates a disk group named data with normal redundancy. Two failure groups, fg1 and fg2, are created, each with two disks identified by associated disk strings. The disk group compatibility attributes are all set to 11.2.

Example 10-64 mkdg sample XML configuration file

<dg name="data" redundancy="normal">
  <fg name="fg1">
    <dsk string="/dev/disk1"/>
    <dsk string="/dev/disk2"/>
  </fg>
  <fg name="fg2">
    <dsk string="/dev/disk3"/>
    <dsk string="/dev/disk4"/>
  </fg>
  <a name="compatible.asm" value="11.2"/>
  <a name="compatible.rdbms" value="11.2"/>
  <a name="compatible.advm" value="11.2"/>
</dg>

The following are examples of the mkdg command. The first example runs mkdg with an XML configuration file in the directory where ASMCMD was started. The second example runs mkdg using information on the command line.

Example 10-65 Using the ASMCMD mkdg command

ASMCMD [+] > mkdg data_config.xml

ASMCMD [+] > mkdg '<dg name="data"><dsk string="/dev/disk*"/></dg>'