Disclaimer

Sunday 11 July 2021

Estimate ASM Rebalance Operation Upfront

 

How to Calculate the ASM rebalance Operation Cost

In this post I will demonstrate you, how you can find out the estimated amount of data that will be relocated by ASM rebalance activity triggered due to your action. This you can estimate in advance before actually executing the actual operation.
The benefit of calculating the Cost upfront is, that you can decide the suitable time period to execute the task and a suitable value of POWER which you should use to finish the task in expected time frame.


Example1:- In this example I want to drop a disk from my disk group TEST_DG but before executing the drop disk command I wanted to know the amount of data ASM has to transfer as part of rebalance activity.

SQL> EXPLAIN WORK SET STATEMENT_ID='DROP_DISK' FOR ALTER DISKGROUP TEST_DG DROP DISK TEST08;
Explained.

SQL> SELECT * FROM V$ASM_ESTIMATE WHERE STATEMENT_ID='DROP_DISK' ;
GROUP_NUMBER   STATEMENT        TIMESTAMP   EST_WORK     CON_ID
-----------------------------------------
4             DROP_DISK       06-JUL-18   2605       0



SQL> select NAME,VALUE from v$asm_attribute where NAME like '%au%'  and GROUP_NUMBER=4;
NAME                                     VALUE
-------------------------------   ----------------------------
au_size                                  1048576

Here drop disk will trigger the relocation of 2605 AU. 
1AU=1MB in my case and therefore it will be 2605MB of Data.

Suppose a case where you have a really big database and the amount of data is really large you definitely want to know upfront to schedule the task and find out the proper value of ASM_POWER_LIMIT to use.



Example2:- In this example I want to add a disk in the same TEST_DG diskgroup. Let us estimate the cost.
SQL> EXPLAIN WORK SET STATEMENT_ID='ADD_DISK' FOR ALTER DISKGROUP TEST_DG ADD DISK 'AFD:TEST09';

Explained.


SQL> SELECT * FROM V$ASM_ESTIMATE WHERE STATEMENT_ID='ADD_DISK' ;
GROUP_NUMBER            STATEMEN       TIMESTAMP   EST_WORK     CON_ID
-------------------------------------------------------------------------------------------
           4                             ADD_DISK           06-JUL-18       1277                       0








No comments:

Post a Comment

100 Oracle DBA Interview Questions and Answers

  Here are 100 tricky interview questions tailored for a Senior Oracle DBA role. These questions span a wide range of topics, including perf...