ASM : Lesson 3 ASM Diskgroups



ASM DiskgroupsOnce the disks are discovered, a diskgroup can be created that will encapsulate one or more of these disks.
It is collection of disks that can managed as logical unit.A diskgroup, which is the highest-level data structure in ASM, is comparable to a LVM’s volume group.

The creation of a diskgroup involves the validation of the disks to be added. These disks must have the
following attributes:
o Cannot already be in use by another diskgroup
o Must not have a pre-existing ASM header
o Cannot have an Oracle file header (from a Oracle raw device datafile)

What happen behind the scene when the diskgroup is created

1) After Disk group is created, metadata is stored in SGA on each disk header and include
Creation data,Disk Group name and Redundancy type is stored in SGA and on each Disk header
2)When a diskgroup becomes mounted, ASM registers the diskgroup name, the instance name, and the
corresponding Oracle Home path name with Cluster Synchronization Services (CSS). This registered data
is then used by the database instance to build the TNS connect string

Some good Queries

1) Suppose you have added few disk in diskgroup and Now you want to know the status of it,then following query would be useful

col name format a12
col path format a25
col mount_status format a7
col header_status format a12
col mode_status format a7
col state format a8
SELECT D.NAME, D.PATH, D.MOUNT_STATUS, D.HEADER_STATUS, D.MODE_STATUS, D.STATE
FROM V$ASM_DISK D, V$ASM_DISKGROUP G
WHERE G.NAME = ‘&1’
AND D.GROUP_NUMBER = G.GROUP_NUMBER;

2) Adding new disks to an existing ASM disk group.
ALTER DISKGROUP DATA ADD DISK ‘/asmdisks/ctdgg’  ;

3) Resizing an ASM disk group.
ALTER DISKGROUP DATA RESIZE ALL SIZE 2000M;

4) Check all disks in a specific disk group; don’t repair them — even if a problem is found
ALTER DISKGROUP DATA CHECK ALL NOREPAIR;

5) Check a specific disk in a specific disk group, and repair the disk if needed
ALTER DISKGROUP DATA CHECK DISK dg_5 ;

6) Manually rebalancing an ASM disk group
ALTER DISKGROUP DATA REBALANCE POWER 10;

7) Mounting and dismounting ASM disk groups
ALTER DISKGROUP DATA DISMOUNT;
ALTER DISKGROUP DATA MOUNT;

8) Drop just one disk
ALTER DISKGROUP DATA DROP DISK DATA_005 ;

9) “Undrop” a recently-dropped disk
ALTER DISKGROUP DATA UNDROP DISK DATA_005 ;

Related Links

ASM introduction

ASM diskgroups

ASM Failure Groups and CSS

ASM parameters

ASM queries

How to move database to ASM storage


Leave a Reply