Oracle MVA

Tales from a Jack of all trades

Shrinking thin provisioned ASM disks results in smaller diskgroup

with 5 comments

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.

Advertisements

Written by Jacco H. Landlust

January 13, 2013 at 3:16 pm

Posted in ASM, RDBMS, VirtualBox, VMWare

5 Responses

Subscribe to comments with RSS.

  1. Dear Jacco,
    This is R*acer,

    It was God who has helped me to find you here. I have exactly same problem, and I’ve been looking for the solutions for almost 2-3 weeks. After surfing through the internet and over 100 forums,I got to know that we can use a tool which is known as ASRU to make storage aware about the deletion of database. And finally I found documents in Oracle website about it. but none of the documents explain how to attach (run, use, take advantage) from this “ASRU”, it was only one example showing the results before using ASRU, and after that. but I couldn’t find anywhere that how to attach it to Oracle, how to make Oracle understand this ASRU tool..
    Then I visited your website, I’ve hopefully read it and gave it a try. But my sqlplus does not recognize these commands.
    I have to mention that, I’m running standalone ASM on SAN storage (block-level), and using raw devices, and Win server 2008 64-bit is the operating system which is chosen for this database server. The Oracle version which I am running is Oracle 11gr2.
    I’ll be thankful if you kindly let me know how am I supposed to “Fire it up?!”

    Best regards.

    R*acer

    October 9, 2013 at 3:14 pm

    • Hi R*acer,

      You can download ASRU currently right here:[url=”http://www.oracle.com/technetwork/products/cloud-storage/asruv12-1517734.html”]http://www.oracle.com/technetwork/products/cloud-storage/asruv12-1517734.html[/]. Rename the .html file to .zip and then unzip.

      The .zip file contains the utility (in perl) and a shell script (ASRU) that you need to transform to windows lingo. The script basically says:
      set ORACLE_HOME (to ASM home!), run %ORACLE_HOME%/perl/bin/perl ASRU.pl

      You might need the perl includes that in the script, maybe that is not required for Windows.

      Let me know if this helps,

      Best,

      Jacco

      Jacco H. Landlust

      October 9, 2013 at 4:19 pm

  2. Hi Jacco,

    Thanks for your help. I got to know what you mean, and I understood the concept. But I am not that much into perl and not familier with the syntax. I run the ASRU.pl and receive an error saying that there is a problem in line 32.
    do you have any idea about it and can you help me with that?

    Warm regards.

    R*acer

    October 30, 2013 at 11:18 am

  3. Jacco, Thanks for the post . We are in a intreresting situation now. we are not able to size after ASRU run back to the original size of the disk. resize fails and we are not able to add datafiles now.

    orasuds

    July 17, 2014 at 7:25 pm

    • That sounds interesting indeed. Would you like help fixing this?

      Jacco H. Landlust

      July 31, 2014 at 10:45 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: