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
  • 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 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.


May 2, 2013

New in Oracle 11g. Rollback on exit in sqlplus

Filed under: Oracle Database — Tags: , , , — oraclelabs @ 10:25

For a very long time it’s been a standard feature of sqlplus to commit on exit. This feature could have been overwritten only by a “WHENEVER SQLERROR EXIT ROLLBACK”, but there was no control for rollbacks when we exit normally. Having autocommit disabled (I am grateful it is disabled by default) and now disabling commit on exit will be very useful in a situation when your sqlplus session is really interactive and you would not appreciate a commit if you exit accidentally.

Here comes in a handy new feature in 11g:


Refer to the documentation on this feature (there is also info on AUTOCOMMIT and how that affects EXIT behavior).

If you want to set this and other features in your sqlplus automatically, you can use what Oracle calls “Default Site Profile Script“:



A user profile (login.sql) can also be used for this purpose, provided that it is located some place where SQLPATH variable points (this is also described in the doc links above).


For some reason, most of the Google search links on this subject led me to the “whenever” command, rather than to “set”.

Blog at