Tuesday, October 30, 2007

My demo system: VMware 6 + OEL5 + Oracle DB 11g

It took me longer to install my demo system as I thought. So be warned when doing this yourself.

My current laptop is a Dell Latitude D820 with 2GB of RAM running a dual boot: Windows XP and Vista. Before I used Windows XP as my demo system, but with the service packs and other installation of software which can interfere with my Oracle config it was too risky to keep it as non-fail demo system. I also wanted to use Windows Vista, but on that, the Oracle database is not supported. Update: according to this it's supported on Windows Vista Business, Enterprise, and Ultimate editions.

So I thought to start using VMware images as demo system. I already tried it in the past (the Oracle VM's) but found it too slow, so I was sceptic about it. But I must admit, it's running fine at the moment.

The time I started with my VM's, Oracle DB 11g for Windows wasn't even out, so I choose for Oracle Enterprice Linux 5 (OEL5). Oracle is putting a lot of effort in linux and using it as their "main" development platform, so most of the soft should come out first for this operating system.

I first used VMware Server (free) to install OEL5, which did work. But when playing with linux and trying to get my network working, I just had one problem after another.
I couldn't understand why it failed, so I tried to use VMware Workstation (not free), which I was sure was supported for Windows Vista. After 5 minutes everything worked.

Tip: When using Windows Vista use VMware Workstation 6 or higher!

The steps I did to get my demo system up and running.

Create a new VMware machine
  1. Select "New Virtual Machine" from VMware to create the hardware specification
  2. Go for a Custom virtual machine configuration - Linux - Linux kernel 2.6.x
  3. I used 1GB Ram, 20GB diskspace, a cd-rom and bridged ethernet
  4. Go with the defaults of the wizard

Install Oracle Enterprise Linux 5

  1. Download Oracle Enterprice Linux from OTN
  2. Unzip the file, you should get 5 iso images
  3. Mount the first cd in your VMware console (Edit virtual machine settings - connection - use iso image)
  4. Start the Virtual Machine
  5. If everything is fine, it will boot the OEL5 cd and will start the wizard for the installation
  6. I used most of the default settings during the installation
  7. Use a static IP address
  8. Select some more packages as default (Customize software packages to be installed) for ex.: Legacy Software Development, Graphical Internet, Development Tools, System Tools
  9. During the installation you'll need to change the cd's (right click on the cd in VMware, Edit and select the other cd)
  10. Reboot the system and finalize the installation

Configure your linux

  1. I had to change the monitor to be able to get a higher resolution
  2. You can also opt to install the VMware Tools which give you some more features
    (I had some problems with these tools as they changed my network settings)
  3. If you prefer to change your shell (for ex. bash instead of ksh), you can do that by using: "chsh". You need to logout and login again so the settings are applied.

Install Oracle Database 11g

  1. Read the installation guide (!). Even the most experienced people sometimes forget to read the installation manual. Something can change in time, the system requirements change, ...
  2. Especially in linux you need to review your kernel parameters and required packages.
    Some of the packages that weren't installed as default, for ex.: libaio-devel-0.3.105-2, unixODBC-devel-2.2.11-1. You find most of the required packages on CD2 and CD3.
    You can use the "rpm -Uvh" command to get them installed.
  3. Create users and groups:
    # groupadd -g 501 oinstall
    # groupadd -g 502 dba
    # useradd -g oinstall -G dba -s /bin/ksh oracle
    # passwd oracle
  4. Append the following to the /etc/sysctl.conf file as the root user and run /sbin/sysctl –p (this command makes the settings immediately applied):
    kernel.sem = 250 32000 100 128
    kernel.shmmax = 536870912
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default = 4194304
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144
  5. The Oracle Universal Installer will verify the requirements, if they are not met you'll get a warning. Before going further, you should review the failed items and resolve the issues.
    Do retry and if all steps are passed successfully, you can start the installation.
  6. I did a normal Enterprise Edition install with the preconfigured database.
  7. You may also check your environment variables (for ex. in /home/oracle/.bash_profile) for the oracle user ($ORACLE_HOME, $PATH, $ORACLE_SID etc.) Make also sure you include the Oracle bin directory in your PATH (export PATH=$PATH:$ORACLE_HOME/bin) so you can run commands from everywhere.

Configure Oracle Application Express (APEX)

  1. To configure APEX you can follow the instruction in the Postinstallation tasks
  2. Before, I always used Apache as my webserver for APEX, but now I thought to go for the embedded PL/SQL gateway
  3. As most of you know, with 11g APEX is preinstalled ;-) The installation is made so easy!
  4. Open a terminal and go to $ORACLE_HOME/apex
  5. Connect with SQL*Plus as sysdba and run @apxconf
  6. It will ask you for the port of the Oracle XML DB HTTP server. I'm not sure 8080 (default) is a great port to use as it's sometimes in conflict with other products... so I used 7779.
  8. Go to your fixed ip or hostname in a browser:
  9. The first time can take some time, but you should see APEX coming up

Tip: Read the manuals!

Some screenshots of my system

If you want to read how to install something like above but in Rac, Frederik (Frikkie) Visser wrote a very good article.

That was basically what I did to create my demo system. During this process, I sometimes "cursed" my machine. John Scott was very supportive, but also teased me more than once with "get a Mac"! We'll see ;-)


Unknown said...

hello, i'm running an oracle 10g on a vmware image, and i have a problem, maybe you have an idea:
the host system is win xp, the system on the vmware image is win xp as well. the db is running on the vm image and i want to connect with an oracle client to that db from the host system, i.e. from outside the vmware. when i try to do this, i get a 'no listener' error, but the listener inside the vm is running..

Anonymous said...

@Dimitri: Mac is a good idea, but you could also start using Oracle VM (XEN) as of today ;-), or better: just linux!

@michel: have a good look at the firewall on XP. On many occasions it has caused issues on communications between host and vm. (you can easily test if that's causing the issue by switching the firewall off before starting vmware)

Anonymous said...

Hi there
I am running oracle 11g on vmvare 6 myself.

one other thing to check out is the virtual network setting check if the vmnet0 is configured to the right network adapter

Anonymous said...

oh i myself always set up 2 network card for vmware, by the way. one i set it up for bridged network and the other for NAT or host-only