Saturday, April 17, 2021

Oracle ASM Rebalancing -- What is Compact Phase and how to disable it

 An ASM rebalance operation comprises three phases,

Planning  
File extents relocation  
Disk compacting 

Where the third one is the compact phase. This attempts to move data as close as possible to the outer tracks of the disks ASM is using. This I/O-heavy phase is completely pointless on a flash system, where I/O is served evenly from any logical address within a LUN.

We  have always  seen rebalancing taking to much time due to  tis compact mode .  

Before 12c, we cannot see compact phase on v$asm_operation view at asm level. If one see EST_MINUTES shows as ‘0’ and waiting for long time, probably its is doing compact. This can be confirmed by seeing system state dump from ASM level and mostly we will see no blocking session and waits are “kfk:async IO”


You can therefore avoid that potentially-massive I/O hit by disabling the compact phase, using the underscore parameter _DISABLE_REBALANCE_COMPACT=TRUE


For 12c onwards, you can use the command below to skip the compact phase:
ALTER DISKGROUP <DG_NAME> SET ATTRIBUTE '_rebalance_compact'='FALSE';



Flash Storage : 

Flash storage is a data storage technology based on high-speed, electrically programmable memory. The speed of flash storage is how got its name: It writes data and performs random I/O operations in a flash.

Flash storage uses a type of nonvolatile memory called flash memory. Nonvolatile memory doesn’t require power to maintain the integrity of stored data, so even if your power goes out, you don’t lose your data. In other words, nonvolatile memory won’t “forget” the data it has stored when the disk is turned off.

Flash storage uses memory cells to store data. Cells with previously written data must be erased before new data can be written. Flash storage can also come in several forms, from simple USB sticks to enterprise all-flash arrays

For DBAs, all-flash storage drives dramatic performance gains in a number of key areas, particularly: database IOPS, query performance, data reduction and backup. In addition, the right all-flash solution will accelerate the availability of analytics, and will reduce the amount of time required to manage the storage solution. With all-flash storage, DBAs don’t have to worry about block size, file systems, performance tuning, LUN management or RAID.


Tuning ASM rebalance operations

The new EXPLAIN WORK FOR statement in 12c measures the amount of work required for a given ASM rebalance operation and inputs the result in V$ASM_ESTIMATE dynamic view. Using the dynamic view, you can adjust the POWER LIMIT clause to improve the rebalancing operation work. For example, if you want to measure the amount of work required for adding a new ASM disk, before actually running the manual rebalance operation, you can use the following:

SQL> EXPLAIN WORK FOR ALTER DISKGROUP DG_DATA ADD DISK data_005;
SQL> SELECT est_work FROM V$ASM_ESTIMATE;
SQL> EXPLAIN WORK SET STATEMENT_ID='ADD_DISK' FOR ALTER DISKGROUP DG_DATA AD DISK data_005;
SQL> SELECT est_work FROM V$ASM_ESTIMATE WHERE STATEMENT_ID = 'ADD_DISK’;

You can adjust the POWER limit based on the output you get from the dynamic view to improve the rebalancing operations.



Reference : 
MOS Note 1902001.1 – What is ASM rebalance compact Phase and how it can be disabled

5 comments:

  1. Hi,

    So if we are using 12c and above version asm we must run
    ALTER DISKGROUP SET ATTRIBUTE '_rebalance_compact'='FALSE';
    for all existing disk group right?

    How to find current or default value of this attribute

    Setting this attribute will redcude io if we add an future disks right?

    Will there be any negative impact if we set this parameter

    ReplyDelete
    Replies
    1. So if we are using 12c and above version asm we must run
      ALTER DISKGROUP SET ATTRIBUTE '_rebalance_compact'='FALSE';
      for all existing disk group right?

      >>>> user Data diskgroups.


      How to find current or default value of this attribute
      >>>>>>>>>> V$ASM_ATTRIBUTE


      Setting this attribute will redcude io if we add an future disks right?
      >>>>>>>>>> Yes


      Will there be any negative impact if we set this parameter
      >>>>>>>>>> no if u r using flash storage

      Delete
  2. Hi @abdul thanks for the Note. Is it recommended to disable with '_' underscore parameter with Oracle team confirmation?

    ReplyDelete
    Replies
    1. Yes why not . Before changing raise sr and get oracle support and ur storage team concurrence that u r using flash storage and after they confirm u can proceed. all hidden and underscore parameters and special attributes can be if coming from oracle support... test in non prod first always

      Delete