Archive for the ‘VirtualBox’ Category
Shrinking thin provisioned ASM disks results in smaller diskgroup
Just the other day I ran out of space on my laptop. That’s what you get with these “tiny” SSD’s nowadays. Anyway, when looking around where I had most data stored I found that an ASM disk in a VM was taking most of the space. This disk, as all my disks for VM’s, was thin provisioned. Usually I use some zero fill utillity overwrite the free space in a think provisioned disk so VirtualBox can shrink the disk. But this sounded risky to me for ASM, also those utilities need an ext filesystem.
Some googling learned me that I wasn’t the first one with this issue. Oracle actually supports a tool for this called ASRU: ASM Storage Reclamation Utility (ASMSRU must have been to long). So, easy comes easy does. Download the utility, fire it up ( ./ASRU -a sysasm DATA ) wait for some time and *presto* . 30 GB back of my 256 GB SSD. How cool is that!
Until about a week later I run into space issues in ASM in the VM I mentioned before. My ASM disk group was full. That sounded hilarious to me, since it was on a 40GB disk (checked it in VirtualBox and yes: still 40GB). Then I remembered ASRU.
Checking the v$asm_diskgroup showed something interesting:
SQL> SELECT name, total_mb, usable_file_mb FROM v$asm_diskgroup; NAME TOTAL_MB USABLE_FILE_MB --------- --------- --------------- DATA 10090 1288
So, ASRU actually not only shrunk the disk, it also resided the disk group in ASM. Now how about that? I didn’t read any statement in the README file saying I had to resize my diskgroup after running ASRU….
SQL> ALTER DISKGROUP data RESIZE ALL; Diskgroup altered. SQL> SELECT name, total_mb, usable_file_mb FROM v$asm_diskgroup; NAME TOTAL_MB USABLE_FILE_MB --------- --------- --------------- DATA 40954 32152
So, if you happen to use ASRU, don’t forget to resize your diskgroup or you will live in interesting times.
Hopes this helps.