Friday, November 18, 2011

Adding an ASM disc group

When CREATE DISKGROUP command is issued, you will assign the disk group its name, and you will add one or more discovered (unallocated) disks to that disk group. Here is an example of the use of the create diskgroup command:

failgroup diskcontrol1 DISK
failgroup diskcontrol2 DISK

In this case, we have created a disk group called dgroup1. It is using normal redundancy and the default  template. Two named failure groups are assigned, diskcontrol1 and diskcontrol2. Each failure group represents one physical or logical disk unit, which has been discovered by ASM. Two separate disks and failure groups are required because of the normal redundancy. If we used high redundancy, we would need to add a third disk to the command, as shown here:

failgroup diskcontrol1 DISK
 ‘/devices/diska1’ NAME diska1
failgroup diskcontrol2 DISK
 ‘/devices/diskb1’ NAME diskb1
failgroup diskcontrol3 DISK
 ‘/devices/diskc1’ NAME diskc1;

   You might have noticed the name clause in the create diskgroup command example earlier. You can also name the disks being assigned to the ASM disk group using the name clause of the create diskgroup command. Failure to use the name clause will result in each disk receiving its own system-default assigned name.  When you create an ASM disk group, Oracle will add that disk group to the ASM_DISKGROUPS parameter on the ASM instance only if you are using an spfile. If you are not using an spfile, you will need to manually add the disk group to the ASM_DISKGROUPS parameter.

The ASM_DISKGROUPS parameter tells Oracle which disk groups it should
mount when the ASM instance is started. You can see the ASM_DISKGROUPS parameter
setting by using the show parameter command from SQL*Plus, as shown here:

SQL> show parameter ASM_DISKGROUPS
NAME                                 TYPE        VALUE
------------------------------------ ----------- --------------------------
ASM_DISKGROUPS                       string      COOKED_DGROUP1, SP_DGROUP2

   If you do not add the disk group to the ASM_DISKGROUPS parameter, you will need to manually mount the disk group.

You might have noticed that each time we create a new disk group (and when we add new disks to a disk group), we give the disk a name. For example, here we create a new disk group called DGROUP1:

failgroup diskcontrol1 DISK
 ‘/oracle01/oradata/asm/disk group1.dsk’ NAME dgroup1_0000;

You can reference the disk group and the disk name by joining the V$ASM_DISK and V$ASM_DISKGROUP views, as shown in this query:

select dg_name, fg_name, path
from v$asm_disk ad
right outer join v$ASM_DISKGROUP adg
on ad.group_number=adg.group_number
-------- --------------- ----------------------------------------
DGROUP1  DGROUP1_0000    /oracle01/oradata/asm/disk group1.dsk

Reference : OCP 11g Administrator Certified Professional Study Guide

No comments:

Post a Comment