Note: Some changes has been performed in below calculation from Newer release of Exadata Machines.
Now in Newer release,
Req_mir_free_MB = Total MB/( No. of cells * No. of Disk [mostly 12])
In Older Exadata Machines,
Req_mir_free_MB = Total MB/ No.of cell
Rest all calculation below is same
=====================================================================
Below calculation is based on Exadata X2 and X3 Machines.
Generally in any Exadata Environment ,we have three disk-groups — DATA (primarily for Datafile etc..) ,RECO (primarily for Backup related files) and DBFS (for voting disk and OCR).
DBFS disk group is something which is fixed, which doesn’t change based on increase in DB size.
DATA and RECO diskgroup is something whose size change is directly based on increase in size of DB.It will directly impact customer capacity planning.
If customer need some extra space in any of the Diskgroup,to configure new DB.It will become quite unjustifiable for DBA in simple terms that we don’t have any space available.
To tackle this situation, DBA will suggest various option to customer. Like..
- Reorg Objects and remove fragmentation in Current DB by various option. ( eg: Reorg,Shrink,by segment advisory etc..) — This is always not a feasible option
- Add more storage server. — Customer will not agree in first go
- Resize Diskgroup,in simple terms,,take some free space from less utilized diskgroup and add it to more utilized diskgroup.
Here we are discussing on Point 3…
Diskgroup Resizing:
Please note that this calculation is for Half Rack ( ie. 4 DB Nodes and 7 Cell Nodes)
Let take an example,suppose we need extra space in Data ( as it becomes negative now ) and we have extra space in Reco.
Now we need to resize Data and Reco .Before resize let take we have 49:51 Ratio between DATA:RECO.
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED HIGH N 512 4096 4194304 22020096 6014096 6291456 -92453 0 Y DATA/
MOUNTED NORMAL N 512 4096 4194304 2087680 2085936 298240 893848 0 N DBFS_DG/
MOUNTED NORMAL N 512 4096 4194304 23455488 15460932 3350784 6055074 0 N RECO/
49:51 Ratio between DATA and RECO
For RECO
Current Storage:
Total = 23455488 MB == 23.36 TB
Free = 15460932 MB == 14.75 TB
Used = 7994556 MB == 7.6 TB
Required MB = 3350784 MB == 3.19 TB
Actual used == Total – Required MB == 20104704 B == 19.17 TB
ACTUAL USABLE_MB =(FREE-REQUIRED_MIRROR)/2 == 11.55/2 TB == 5.77 TB === 6055074 MB
Note: ACTUAL USABLE_MB =(FREE-REQUIRED_MIRROR)/2 — 2 here for normal redundancy
For DATA
Current Storage:
Total = 22020096 MB == 21 TB
Free = 6014096 MB == 5.73 TB
Used = 16006000 MB == 15.26 TB
Required MB = 6291456 MB == 6 TB
Actual used == Total – Required MB == 15728640 B == 15 TB
ACTUAL USABLE_MB =(FREE-REQUIRED_MIRROR)/3 == -0.27/3 TB == -0.09 TB === -92453 MB
Note: ACTUAL USABLE_MB =(FREE-REQUIRED_MIRROR)/2 — 3 here for high redundancy
Assumption to perform resize (60:40 Approx )
RECO
Total = 18 TB(taking away 5.36TB)
Free = 10.4 TB
Required Mirror = 18/7 TB = 2.57 TB == 2696338 MB
Actual usable mb == 7.83/2 == 4105175 MB == 3.915 TB
DATA
Total = 26.36 TB (adding 5.36 TB from reco)
Free = 11.10 TB
Required Mirror = (26.36/7)*2 == 7.53 TB
Actual usable_mb = (FREE-REQUIRED_MIRROR)/3 == 3.56/3 == 1.18 TB (Approx) — That is the value which we have to look
Current disk size
Reco== 272.6875
Data== 256
Total== 528.6875
After Resize (approx)
===================
Reco== 207.6875
Data== 321
Total== 528.6875
To check space of griddisk ,we need to use below command.
list griddisk attributes name,asmmodestatus ,size.
Note: The above calculation is not much required ,if we apply mathematical calculation directly based on griddisk size.
Steps to perform while resizing .It should be in rolling or non-rolling based on downtime from customer.
1> Drop Old disk 2> Resize them and 3> Add them back .
1> DROP OPERATION :
- a) connect to ASM instance as sysam on first DB node
SQL > select * from gv$asm_operation ( should show no rows )
SQL > alter diskgroup DATA drop disks In failgroup cell1 rebalance power 11 nowait;
- b) connect to ASM instance as sysam on second DB node
SQL > select * from v$asm_operation ( should not show as RUN for second instance)
SQL > alter diskgroup RECO drop disks In failgroup cell1 rebalance power 11 nowait;
- c) Wait for rebalance to complete
select * from gv$asm_operation; (make sure you are firing this query by connecting to ASM instance as sysasm)
- d) col path for a50
set lines 300
set pages 300
select path,name,mount_status,header_status,mode_status,state from v$asm_disk where failgroup= ‘cell1’ order by name; (crosscheck for dropped disks)
2> RESIZE OPERATION
Example: For cell1
Connect to cell1
CELLCLI > list griddisk attributes name,asmmodestatus (should show UNUSED for dropped disk)
CELLCLI > drop griddisk all prefix=’RECO’ force;
CELLCLI > drop griddisk all prefix=’DATA’ force;
CELLCLI > list griddisk
CREATE GRIDDISK ALL PREFIX=’DATA’, size=new size
CREATE GRIDDISK ALL PREFIX=’RECO’, size=new size
Crosscheck the newly resized disks
CELLCLI > list griddisk attributes name,size
3> ADD OPERATION
connect to ASM instance as sysam on first DB node
select * from gv$asm_operation ( should show no rows )
SQL > alter diskgroup DATA add disk ‘o/*/DATA*cell1*’ rebalance power 11 nowait;
connect to ASM instance as sysam on 2nd DB node
SQL > select * from v$asm_operation ( should not show as RUN for second instance)
SQL > alter diskgroup RECO add disk ‘o/*/RECO*cell1*’ rebalance power 11 nowait;
Wait for rebalance to complete
select * from gv$asm_operation; (make sure you are firing this query by connecting to ASM instance as sysasm)
Monitor rebalance:
SQL> col ERROR_CODE for a20
SQL> set lines 300
SQL> set pages 300
SQL> select INST_ID,OPERATION,STATE,POWER,SOFAR,EST_WORK,EST_MINUTES,ERROR_CODE from gv$asm_operation;
Note: For rolling,Please repeat same step on each cellnodes one by one.For Non-rolling we don’t need to wait for re-balancing.
Just shutdown all cellnodes after making all griddisk inactive and resize the disk after drop.Add them back altogether with new size.