[dunblog] [Le Blog de Dun] Oracle XE on OpenVZ : the SWAP problem resolved

  • From: Le Blog de Dun - <dun@xxxxxxxx>
  • To: dunblog@xxxxxxxxxxxxx
  • Date: Thu, 16 Oct 2008 09:54:27


After having successfully installed Oracle Express Edition 10G (XE) on a 
standard ubuntu distro, I tried to do the same thing within an OpenVZ 
container. I used Proxmox VE as a host system and created a virtual appliance 
using the ubuntu 8.04 minimal template. Until there no problem, now if you try 
to use the standard installation process like this : 
open /etc/apt/sources.list and add this line    deb 
http://oss.oracle.com/debian unstable main non-free
Then execute the following commands as root (or with sudo) to add Oracle's 
public signing key and then install Oracle XE:

# wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle  -O- | sudo apt-key add - 
# apt-get update
# apt-get install oracle-xe

You will have a problem just now. The installer will check the size of the swap 
and find it is set to zero. OpenVZ manage the swap for your VM so you can not 
change it. Use the swapon command will fail.
So here is the solution I found (have few hours of failed attempts):
Extract manually the content of the deb. Usually the deb file can be found in 
To do this you can use the dpkg -X command.
Copy the content of the deb archive to the right place : 
# cp -R ./usr /
# cp -R ./etc /

Create a new user and a new group : 

Give the ownership of the /user/lib/oracle to this user : 
# chown -R oracle:dba /usr/lib/oracle

Edit the nls_lang.sh and replace #!/bin/sh by #!/bin/bash: 
#  nano /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh

Run the oracle_env.sh to simplify the process : 
#  . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

Change the user rights on the oracle binary : 
# chmod u+s $ORACLE_HOME/bin/oracle
# chmod g+s $ORACLE_HOME/bin/oracle

Search and replace a substitution variable : 
# cd /usr/lib/oracle
# find . -exec grep &quot;%sga_&quot; '{}' \; -print

You should find two .ora files, you have to search for the %sga_target% 
variable and %pga_aggregate_target%
You have to replace them by :

Almost ok, we just need now to execute the configuration script : 
# /etc/init.d/oracle-xe configure

And everything should start normally.

I hope this little tutorial will help, do not hesitate to comment if you are in 

Le Blog de Dun est propulsé par Serendipity.
Le blog des blogs que vous aussi pouvez utiliser!.
Allez sur , le site officiel.

Other related posts:

  • » [dunblog] [Le Blog de Dun] Oracle XE on OpenVZ : the SWAP problem resolved