Purpose
Changes a disk group (adds disks, drops disks, resizes disks, or rebalances a disk group) based on an XML configuration file.
Syntax and Description
chdg { config_file.xml | 'contents_of_xml_file' }
Table 10-42 lists the syntax options for the chdg command.
Table 10-42 Options for the chdg command
| Option | Description |
|---|---|
|
|
Name of the XML file that contains the changes for the disk group. For examples of the valid tags and XML configuration file, see Example 10-51 and Example 10-52. |
|
|
The XML script enclosed in single quotations. |
chdg modifies a disk group based on an XML configuration file. The modification includes adding, replacing, or deleting disks from an existing disk group, and the setting rebalance or replace power level. The power level can be set to the same values as the ASM_POWER_LIMIT initialization parameter. For information about the initialization parameter, see "ASM_POWER_LIMIT".
When adding disks to a disk group, the diskstring must be specified in a format similar to the ASM_DISKSTRING initialization parameter. For information about the initialization parameter, see "ASM_DISKSTRING".
The failure groups are optional parameters. The default causes every disk to belong to a its own failure group. For information about failure groups, see"Oracle ASM Failure Groups".
Dropping disks from a disk group can be performed through this operation. An individual disk can be referenced by its Oracle ASM disk name. A set of disks that belong to a failure group can be specified by the failure group name. For information about dropping disks, see"Dropping Disks from Disk Groups".
You can resize a disk inside a disk group with chdg. The resize operation fails if there is not enough space for storing data after the resize. For information about resizing disks, see"Resizing Disks in Disk Groups".
Example 10-51 shows the basic structure and the valid tags with their respective attributes for the chdg XML configuration file.
Example 10-51 Tags for the chdg XML configuration template
<chdg> update disk clause (add/delete disks/failure groups)
name disk group to change
power power to perform rebalance or replace
<add> items to add are placed here
</add>
<replace> items to replace are placed here
</replace>
<drop> items to drop are placed here
</drop>
<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>
</chdg>
For information about creating a disk group with ASMCMD mkdg, see "mkdg". For information about altering disk groups, see "Altering Disk Groups".
Example
The following is an example of an XML configuration file for chdg. This XML file alters the disk group named data. The failure group fg1 is dropped and the disk data_0001 is also dropped. The /dev/disk5 disk is added to failure group fg2. The rebalance power level is set to 3.
Example 10-52 chdg sample XML configuration file
<chdg name="data" power="3">
<drop>
<fg name="fg1"></fg>
<dsk name="data_0001"/>
</drop>
<add>
<fg name="fg2">
<dsk string="/dev/disk5"/>
</fg>
</add>
</chdg>
The following are examples of the chdg command with the configuration file or configuration information on the command line.