The post provides you an example about how to create an ASM diskgroup using XML code through the asmcmd command.
1. Create a XML file (e.g. diskgroup.xml) with the next code:
<dg name="datadg" redundancy="normal"> <fg name="SAN1"> <dsk string="ORCL:ASMDISK1"/> <dsk string="ORCL:ASMDISK2"/> </fg> <fg name="SAN2"> <dsk string="ORCL:ASMDISK3"/> <dsk string="ORCL:ASMDISK4"/> </fg> <a name="compatible.asm" value="11.2"/> <a name="compatible.rdbms" value="11.2"/> <a name="compatible.advm" value="11.2"/> </dg>
2. Then execute the XML script thru ASMCMD as follow:
$ asmcmd mkdg diskgroup.xml
3. Validate the diskgroup was created:
SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 1 17:59:37 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option
SQL> select name, state, type from v$asm_diskgroup;
NAME STATE TYPE
------------------------------ ----------- ------
ACFSDG MOUNTED EXTERN
DATA MOUNTED NORMAL
DATADG MOUNTED NORMAL
RECO MOUNTED NORMAL