Oracle Labs by Yuri Khazin, Oracle DBA

December 30, 2014

Building a Virtual Oracle RAC – Project Introduction


This article was originally written in 2010 and then updated several times. In 2010 the Virtual Box belonged to Sun Microsystems, now it is a part of Oracle’s toolbox. The interface of Virtual Box has somewhat changed over the years, so my apologies to the reader for screen snapshots that don’t look exactly like today’s version. You can still download older version of the program so that chances are that you won’t encounter issues while trying out this guide.

Introduction: This learning experiment is about building a totally virtual Oracle RAC environment at home using only open source software available to wide public (With the exclusion of Windows, if you happen to use it. I wish there was an open source version of MS Windows, that would benefit MS as well. Works for Red Hat, right?).

My project is generally based on an excellent article by Jeffrey Hunter (and other authors) – Build Your Own Oracle RAC Cluster on Oracle Enterprise Linux and iSCSI

Jeffrey’s article gives instructions on how to build a physical setup. I do recommend reading this article or at least giving it some 10 minutes scan before you attempt to build a RAC. In that article Jeffrey estimates a cost to build a production RAC in physical environment between $20K and $30K. He shows that for the purposes of learning the technology a “mostly physical” RAC with some parts virtualized can be built for under $2700. I am going to take the virtualization to the extreme and build a RAC inside a single PC. Yes, I do not care now about performance, and yes, I am willing to buy some additional memory for the PC. You can not really expect to run two Linux nodes with databases and a storage (SAN) simulation on a PC with 1GB of memory. My estimated cost is, therefore, somewhere under $100, if all we need is a memory upgrade. Sounds good? It is still a lot of work and it will probably take you many hours to do it right. The benefit is a hands on knowledge, which is priceless.

Now to the choice of hardware and software.

  • PC or server with some 200GB space and 3.5GB memory (XP Professional can handle up to 4GB).
  • The host OS: Windows XP SP3 professional (although SP2 will probably do as well)
  • Has been tested on Windows 7 Home and shown no issues
  • Can work on Linux host machine (Ubuntu, Debian, openSUSE, Fedora etc)
  • Virtualization software: Virtual Box 3.1.2 (or higher). Tested and works with no issues on both Intel and AMD processors (may need to adjust some CPU parameters in configuration).
  • Database nodes: Oracle Enterprise Linux 5 update 3 as a guest OS, running Oracle Database 10.2.0.1
  • SAN/NAS emulation software: Openfiler 2.3

My reasons for choosing particular software:

Host OS does not really matter, virtualization software can run on many different platforms. If you desire so, you can run this whole project using Linux as a host. Virtual Box is selected because it is an open source software produced by Oracle.  Virtual Box at 3.1.2 was still owned by Sun Microsystems, who acquired it from Innotek and then maintained from 2008. Oracle maintains this product from 2010.

Why Virtual Box and not VMware? VMware is a popular product but I do not see a consistency in their support of free versions of the software. In my experiments with VMware I have encountered some obstacles while running Linux guests (particularly in networking and CPU clock synchronization). Virtual Box is an open source product and quite a mature one, well documented and supported. So far I was able to run OEL4 and OEL5 with no issues (even with no guest additions installed). I like the product’s built-in networking, it seems to be more flexible and stable. These are all my personal preferences, of course.

Why Oracle’s Linux? This particular flavor of Linux is a modified Red Hat Enterprise Linux 5. Oracle has made a few adjustments that allow Oracle 10g R2 database (32 bit) to install with no issues on it (usually, no additional RPM’s required). Since I am aiming to install Oracle in the guest(s) thus the choice of this Linux flavor. Besides, this Linux comes with OCFS2 and most of the ASMLib software packages installed. If you have a licensing question about Oracle Enterprise Linux (OEL) I can answer it. You only need a license if you want Oracle’s support. For learning purposes you do not need a license. If you will need to download some rpm libraries and updates you can get those for free, the YUM configuration can be pointed to a free repository (not discussed here).

Now the database itself. Which edition of 10.2.0.1 are we going to use? There is no clarity in that article on this matter, for now I assume the Standard Edition will do. There are some additional pieces of software from Oracle (or used by Oracle) to be installed, those are: OCFS2, ASMLib 2.0 and TAF.

Now that we know what we need to get started let’s split the work into more manageable mini projects, follow them just in this order, and hopefully all pieces will fit:

Update (2015). There seems to be a viable alternative to Openfiler from the FreeNAS. First off, it is Free. Second, it is open source (or, maybe that was first). Then, they give you full documentation. There was time when we were on our own with Openfiler, as they wanted money for the tech documentation.

March 13, 2013

Oracle Virtual Server (Oracle VM, OVM) inside Virtual Box


As if Oracle Virtual Box was not virtual enough, now you can put one dream into another dream, just like in my favorite movie Inception.

Get this, you can run Oracle Virtual Server (other names: Oracle VM, OVM) inside Virtual Box. Wrap you mind around that…

Now, for confused, Oracle VM Server is a product separate from Virtual Box and comes with it’s own history. As far as I know, Oracle VM Server is a Xen Linux based software that is not hosted, i.e. installs onto a bare metal hardware. Virtual Box, in turn, is hosted and can run within almost any known operating system. Virtual Box was not always Oracle’s product and not even Sun’s, it was originally developed by Innotek.

So… if you wanted to test drive a VM Server farm but don’t have some 4-5 physical servers lying around, you can still do so if you put it all in Virtual Box environment.

Oracle provides VirtualBox Templates for Oracle VM Manager and Oracle VM Server. From these templates you can create actual guests in Vritual Box. (Once again, this is not an installation media for physical servers but VM templates. If you are after that sort of media, you need to go to Oracle Software Delivery Cloud – Oracle Linux and Oracle VM).

To run this virtual farm you will need a lot of RAM on a single machine or, even better, run this setup on two machines. One PC can run the VM Manager and another will run one or two VM Servers. So much fun with the networking!

Follow the instructions on the download page, they are quite thorough. The only trouble I have had with version OVM 3.1.1  template (build 365) was that VM Manager comes with Oracle Express Edition 11g as an internal repository and it won’t start after guest starts for the first time. Turns out, there is a MEMORY_TARGET parameter in spfileXE.ora that is set to about 1GB and there was not enough free memory. Once this parameter was removed the database started and all works like a charm after guest reboot. I run this guest with 1.6GB RAM and the VM Servers needs 4GB at least (starts with 3GB but not sure if it works well). Honestly, I have not tried to create a guest inside VM Server yet, but I suspect I may need much more RAM for that (notice to self, update this post when I try).

One more thing. VM Manager is a browser based control interface for OVM, you can run it within your guest machine but it is better to do so from your PC. In that case you will need to check that firewall is turned off in the VM Manager guest (service iptables stop, then set it in chkconfig so it will stay stopped after reboot). Check firewall on your PC as well. Direct your browser to the guest IP address and appropriate port. If you somehow happened to install OVM 3.2.1, notice that http is now replaced by https and default port is not 7001 but 7002.

Good luck on your test drive.

April 26, 2011

VirtualBox 4.0.4 and network


It is always exciting to play with new release of this favorite toy of mine. Not this time though. There are some changes in release 4.0.4 that I could not cope with. I was using release 3.2.12 before, it looks very modest and just works well. So first thing I have noticed in the new release was the sweeping changes to overall GUI, then I was puzzled by a disappearance of the button “New” in the “Virtual Media Manager” interface and finally, when installing OEL 5.2 (Red Hat), I could not get the Host-Only networks to actually work (the adapters were up and running but not accessible from host).

Some people have already complained about the problem that manifests itself as error message:

“the value of the MAC address field on the network page is not complete”

You can look at the discussion on the topic here (but there was no resolution at that time):

http://forums.virtualbox.org/viewtopic.php?f=6&t=38253

According to some, the problem surfaces when you have more than one network interface, according to others it is only with some operating systems. As of this moment I gave up on this new release and reverted back to 3.2.12

Create a free website or blog at WordPress.com.