Oracle Automatic Storage Management(ASM) was introduced in release 10g. ASM is Oracle’s logical volume manager, it uses OMF (Oracle Managed Files) to name and locate the database files. It can use raw disks, filesystems, or files which can be made to look like disks as long as the device is raw.

ASM uses its own database instance to manage the disks. It has its own processes and pfile or spfile and uses ASM disk groups to manage disks as one logical unit. In some ways ASM makes things more complicated – like accessing the files, copying to different locations, and viewing the time stamps of the files. It’s considered good practice to create one disk group for data (DATA) and one for archive logs and fast recovery area(FRA) per ASM instance. One disk group gets created during the cluster install and configuration (OCR). For a larger production database it’s common for it to have its own DATA and FRA disk groups.

Let’s create 2 disk groups: DATA and FRA. In this example we are going to do it on a Lunix Suse server. Our disks are /dev/sdc, /dev/sdd, /dev/sde, and /dev/sdf. (Note: If the disks are mirrored within a storage array, there is no need to utilize the ASM mirroring feature.)

SQL> create diskgroup DATA external redundancy disk '/dev/sdc';

Diskgroup created.

Here is an example of how to do it with normal redundancy – allowing ASM mirroring.  At least 2 disks are required to create the disk group with normal redundancy:

SQL> create diskgroup FRA normal redundancy disk '/dev/sdd', '/dev/sde';

Diskgroup created.

It is important to specify compatibility parameters for asm and rdbms while creating the disk groups. COMPATIBLE.ASM parameter determines the minimum software version for any Oracle ASM instance that uses a disk group. If this parameter is not set, the default value is 10.1. RDBMS parameter determines the minimum software version for any database instance that uses a disk group. If this parameter is not set, the default value is also 10.1.

Here is an example of creating a disk group DATA with normal redundancy and compatibility settings:

SQL> drop diskgroup FRA;

Diskgroup dropped.

SQL> drop disk group DATA;

Diskgroup dropped.

SQL> create diskgroup DATA normal redundancy disk '/dev/sdd','/dev/sdc' 
  2     ATTRIBUTE
  3     'compatible.asm' = '11.2',
  4     'compatible.rdbms' = '11.2';

Diskgroup created.

Here is the example of setting up a custom AU_SIZE – the size of the allocation unit for the disk group:

SQL> create diskgroup FRA normal redundancy disk '/dev/sde','/dev/sdf'
  2     ATTRIBUTE 'au_size'='4M',
  3     'compatible.asm' = '11.2',
  4     'compatible.rdbms' = '11.2';

Diskgroup created.

ASM load balances the file activity by uniformly distributing file extents across all of the disks in a disk group. If new disks are added to a disk group or the disks are dropped from a disk group, ASM automatically rebalances(redistributes) file data evenly across all the disks of the disk group. It’s all happening with the database being online. The larger the disk group, the longer it takes to do the rebalancing. There is always a possibility for performance impact on I/O activity. It is recommended to add/drop disks during off hours during minimum load on the database. The rebalancing operation can be sped up by changing ‘rebalancing power’ for the disk group.

SQL> alter diskgroup FRA rebalance power 6;

Diskgroup altered.

Here is how the re-balancing can be monitored:

SQL> select group_number, operation, state, power, sofar from v$ASM_OPERATION;

GROUP_NUMBER OPERA STAT      POWER  SOFAR
------------ ----- ---- ---------- ----------
           2 REBAL REAP          6          0

SQL> select group_number, operation, state, power, sofar from v$ASM_OPERATION;

GROUP_NUMBER OPERA STAT      POWER  SOFAR
------------ ----- ---- ---------- ----------
2 REBAL RUN           6          0

When rebalancing is done, change ‘rebalancing power’ back to 1:

SQL> alter diskgroup FRA rebalancing power 1;

Diskgroup altered.

Here is how to drop an empty disk group:

SQL> drop diskgroup FRA;

Diskgroup dropped.

SQL> drop diskgroup DATA;

Diskgroup dropped.

Comment