Little Things Doth Crabby Make – Part XVIII. Automatic Storage Management Won’t Let Me Use My Disk For My Files! Yes, It Will!

It’s been a long time since my last installment in the Little Things Doth Crabby Make series and to be completely honest this particular topic isn’t really all that fit for a LTDCM installment because it covers something that is possible but less than expedient.  That said, there are new readers of this blog and maybe it’s time they google “Little Things Doth Crabby Make” to see where this series has been. This post might rustle up that curiosity!

So what is this blog post about? It’s about stuffing any file system file into Automatic Storage Management space. OK, so maybe this is just morbid curiosity or trivial pursuit. Maybe it’s just a parlor trick. I would agree with any of those descriptions. Nonetheless maybe there are 42 or so people out there who didn’t know this. If so, this post is for them.

ASMCMD cp Command

The cp sub-command of ASM lets you stuff certain database files into ASM. We all know this. However, just to make it all fresh in people’s minds I’ll show a screen shot of me trying to push a compressed tar archive of $ORACLE_HOME/bin/oracle up into ASM:

2014.02.04-pic-0

Well, that’s not surprising. But what happens if I take heed of the error message and attempt to placate? The block size is 8KB so the following screen shot shows me rounding up the size of the compressed tar archive to an 8192B blocking factor:

2014.02.04-pic-0.1

ASMCMD still won’t gobble up the file. That’s still not all that surprising because after ASMCMD checked the geometry of the file it then read the file looking for a header or any file magic it could understand.  As you can see ASMCMD doesn’t see a file type it understands. The following screen shot shows me pre-pending the tar archive with file magic I know ASMCMD must surely understand. I have a database with a tablespace called foo that I created in a non-Oracle Disk Manager naming convention (foo.dbf). The screen shot shows me:

  1. Extracting the foo.dbf file
  2. “Borrowing” 1MB from the head of the file
  3. Creating a compressed tar archive of the Oracle Database executable
  4. Rounding up the size of the compressed tar archive to an 8192B blocking factor

2014.02.04-pic1

 

So now I have a file that has the “shape” of a datafile and the necessary header information from a datafile. The next screen shot shows:

  1. ASMCMD cp command pushing my file into ASM
  2. Removal of all of my current working directory files
  3. ASMCMD cp command pulling the file form ASM and into my current working directory
  4. Extracting the contents of the “embedded” tar archive
  5. md5sum(1) proof the file contents survived the journey

2014.02.04-pic2

OK, so that’s either a) something nobody would ever do or b) something that can be done with some elegant execution of some internal database package in a much less convoluted way or c) a combination of both “a” and “b” or d) a complete waste of my time to post, or, finally, e) a complete waste of your time reading the post. I’m sorry for “a”,”b”,”c” and certainly “e” if the case should be so.

Now you must wonder why I put this in the Little Things Doth Crabby Make series. That’s simple. I don’t like any “file system” imposing restrictions on file types 🙂

 

12 Responses to “Little Things Doth Crabby Make – Part XVIII. Automatic Storage Management Won’t Let Me Use My Disk For My Files! Yes, It Will!”


  1. 1 Hameed, Amir February 6, 2015 at 2:20 pm

    That was clever Kevin!

  2. 3 jkstill February 6, 2015 at 2:49 pm

    interesting stuff Kevin. Now how the database chokes on it. Anyone want to predict the error message?

    • 4 kevinclosson February 6, 2015 at 2:54 pm

      Hi Jared,

      What do you mean by chokes on it? What database would be choking?

      • 5 jkstill February 6, 2015 at 2:59 pm

        As you have fooled ASM into accepting it, use Transportable Tablespace to see what happens when the database tries to open it.

        • 6 kevinclosson February 6, 2015 at 3:03 pm

          @jkstill: oh yeah…that’s a “corrupt” file now for sure. but you can jump on any node in the cluster, suck it out and extract the embedded goodies. Fun calisthenics 🙂

          I actually do save very large tar archives this way on occasions FWIW.

          • 7 jkstill February 6, 2015 at 3:09 pm

            Kevin, what is the purpose of saving the files in ASM?

            • 8 kevinclosson February 6, 2015 at 3:29 pm

              On occasions I’ve found myself in a lab situation where hosts have about zero usable space and I can’t borrow any more space from the SAN to create a file system. Just odd scenarios like that.

              • 9 jkstill February 7, 2015 at 10:41 am

                You could install ACFS on top of ASM, unless you just don’t want the files to be easily visible.

                • 10 kevinclosson February 7, 2015 at 12:03 pm

                  Yes, you can do that. No surprise. You could setup ADVM and create an Ext3/Ext4 FS in the ASM space.

                  You could create a DBFS in a database in the ASM space.

                  You could create a database inside ACFS inside ASM and in that database create a DBFS. Then you’d have a file in a file system in a database inside a file system inside a database volume manager…

                  The list goes on 🙂

                  • 11 robinsc February 19, 2015 at 4:12 am

                    Seeing as the current thought on engineered systems like ODA and EXADATA is to put everything on ACFS in ASM I have a feeling that ACFS is probably the way things are going to go in future…
                    If so asmcmd copy command will not nbe needed any more 🙂
                    Okay okay so I drank the oracle Kool Aid… I can’t help it I am a sucker for … ooh shiny !


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.




DISCLAIMER

I work for Amazon Web Services. The opinions I share in this blog are my own. I'm *not* communicating as a spokesperson for Amazon. In other words, I work at Amazon, but this is my own opinion.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 744 other subscribers
Oracle ACE Program Status

Click It

website metrics

Fond Memories

Copyright

All content is © Kevin Closson and "Kevin Closson's Blog: Platforms, Databases, and Storage", 2006-2015. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Kevin Closson and Kevin Closson's Blog: Platforms, Databases, and Storage with appropriate and specific direction to the original content.

%d bloggers like this: