Automatic Storage Management Fast Mirror Resync

The main purpose of Introducing ASM was to provide a batter Data Redundancy to the database and to discourage RAID at hardware level. ASM provides three types of redundancy.

1. Normal Redundancy
2. High Redundancy
3. External Redundancy.

In normal Redundancy one copy of data is maintained, High Redundancy maintains two copies of data into another disks and External leave it to external sources.

In Oracle 10g, whenever a disk goes offline i.e. not accessible to Automatic Storage Management for data reading/writing purpose. It drops the disk from disk group and as per redundancy start making new copies of extents to other disks and this is a very expensive process for I/O operations.

Suppose the disk failure was a temporary issue and got fixed in few hours and disk is back now, so ASM will again start rebalanced the data using this disk. In conclusion, temporary failure of disk needs two rebalance operations first when disk goes offline and second when disk is online.

In Oracle 11g, this two time balancing is reduced by using two things Disk_repair_time and keeping track of changed extents during disk offline time. Every disk group has a default disk_repair_time (3.6 Hours) for which it can tolerate disk unavailability. This parameter can modify using below command.

sql> alter diskgroup set attribute 'disk_repair_time' = '4.5h';

As the disk goes offline, Automatic Storage Management start keeping track of changed extents using redundant copy of disk. Automatic storage Management will only write changed data into disk when this will be online. This wait will continue until disk_repain_time is over, if disk comes back before this time ASM will only update changed data into disk.

If disk doesn't come back until disk_repain_time, it will drop the disk from disk group and start rebalance operation.

Using this method, we can choose a time by which Automatic Storage Management will wait disk to come back and can avoid disk rebalanced operations done in previous version.

Query to find disk_repair_time for a disk group:

SQL> select name,value,group_number from v$asm_attribute where name like 'disk_repair%';

NAME                 VALUE    GROUP_NUMBER
-------------------- -------- ------------
disk_repair_time     3.6h                1
disk_repair_time     3.6h                2


ASM Preferred Mirror Read

Until Oracle 10g, Automatic Storage Management used to read only Primary copy of extents. This works fine if Real Application Cluster environment is not extended. In case of extended RAC (when RAC nodes and Storage are placed at different locations) suppose there are two sites A (with RAC node and storage) and B (with RAC node and storage) located at two different locations.

If node B needs and extent which has primary copy at Storage A and mirror copy at Storage B, So, B has to go to Storage A for primary copy which cause a high traffic on network.

To overcome this, Oracle 11g introduce ASM preferred Mirror Read. Reference from above example, Now, if B has mirror copy of extent at storage B, it will read mirror copy only rather than
going to primary extent at site A and will increase the performance.

How to Setup ASM Preferred Mirror Read:

A new parameter ASM_PREFERRED_READ_FAILURE_GROUP is introduced at ASM instance level. Each Automatic Storage Instance has this parameter value which should points to its local disk groups.
Each time when there is a read request and extent exists at local disks either primary or mirror copy it will read from local disk and gives a improved performance.

 Command to change parameter

SQL> alter system set asm_preferred_read_failure_groups='ams_diskgroup_name.asm_failure_group_name';



Steps to follow

SQL> select name from v$asm_diskgroup;

NAME
------------------------------
DATA
FRA

SQL> select name,failgroup from v$asm_disk;

NAME                           FAILGROUP
------------------------------ ------------------------------
DATA_CD_DISK03            DATA_CD_DISK03
DATA_CD_DISK01            DATA_CD_DISK01

SQL> alter system set asm_preferred_read_failure_groups='DATA.DATA_CD_DISK03';

System altered.

Crosscheck for implementation

SQL> SHOW PARAMETER asm_preferred_read_failure_groups;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_preferred_read_failure_groups    string      DATA.DATA_CD_DISK03

SQL> select preferred_read from v$asm_disk;

No comments:

Post a Comment