In the last post I showed mathematically how ASM calculates the free usable space that it displays. However one of the first questions I received after presenting that internally was from someone concerned about all of the unusable space being saved just in case we lose a disk. (In my worked example it was 1/6 of the disk capacity! And what if we don’t care about restoring redundancy before we replace the failed disk?)
But it turns out that ASM actually handles this quite nicely – the “usable space” is used only for display and alerting. If a datafile needs to autoextend or if an archivelog needs to be created then ASM will keep using space until it completely exhausts everything physically available. It will go ahead and use the “reserved space” and just report a negative amount of free space! Here’s the output of my test confirming this behavior:
SQL> alter database datafile 2> '+TEST01/js1_rh5lab20/datafile/filler.256.681667743' resize 18G; Database altered. . rh5lab20$ asmcmd dgs State Type Rebal Sector Block AU Total_MB Free_MB MOUNTED NORMAL N 512 4096 1048576 38561 1529 Req_mir_free_MB Usable_file_MB Offline_disks Name 7844 -3157 0 TEST01/ . rh5lab20$ asmdf Filesystem SizeKB UsedKB AvailKB Use% Mounted on +TEST01 15727104 18959872 -3232768 120.56% TEST01
There is also a second way to get negative usable space in ASM. If you do experience a failure, then ASM will restore your redundancy level making new copies of the data that was on the failed disk(s). It will use the “reserved space” on your disks. After the rebuild is complete, ASM will recalculate the amount of reserved space it needs to protect from a second failure. If you were using most of the space before the first failure then ASM might report a negative amount of usable space after the rebuild.
It’s important for you to remember that negative free space doesn’t mean your data isn’t safe – you just won’t be able to restore redundancy after the failure. In other words, if you have negative free space then you cannot physically survive two subsequent failures without data loss (or three with high redundancy/triple mirroring). But ASM allows the negative numbers because it’s smart enough not to hang your database when it can be avoided (for example if archivelogs fill up the reported usable space).