Skip to content

Instantly share code, notes, and snippets.

@Tracnac
Last active September 23, 2022 15:59
Show Gist options
  • Save Tracnac/a32ba1b6eb9e5f699f13dc1d25adda0a to your computer and use it in GitHub Desktop.
Save Tracnac/a32ba1b6eb9e5f699f13dc1d25adda0a to your computer and use it in GitHub Desktop.
ASM Imbalance #oracle #sql

ASM Imbalance

select group_number, min(free_mb),max(free_mb) from v$asm_disk group by group_number;

column "Diskgroup" format A30
column "Imbalance" format 99.9 Heading "Percent|Imbalance"
column "Variance" format 99.9 Heading "Percent|Disk Size|Variance"
column "MinFree" format 99.9 Heading "Minimum|Percent|Free"
column "DiskCnt" format 9999 Heading "Disk|Count"
column "Type" format A10 Heading "Diskgroup|Redundancy"

SELECT g.name "Diskgroup",
100*(max((d.total_mb-d.free_mb)/d.total_mb)-min((d.total_mb-d.free_mb)/d.total_mb))/max((d.total_mb-d.free_mb)/d.total_mb) "Imbalance",
100*(max(d.total_mb)-min(d.total_mb))/max(d.total_mb) "Variance",
100*(min(d.free_mb/d.total_mb)) "MinFree",
count(*) "DiskCnt",
g.type "Type"
FROM v$asm_disk d, v$asm_diskgroup g
WHERE d.group_number = g.group_number and
d.group_number <> 0 and
d.state = 'NORMAL' and
d.mount_status = 'CACHED'
GROUP BY g.name, g.type;

alter system set "_asm_imbalance_tolerance"=0 scope=both sid='*';

alter diskgroup &1. check all repair;
alter diskgroup &1. rebalance power 11;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment