How to install Oracle XE 18c in Oracle Cloud Free Tier


27.09.2019
by Kamil Stawiarski

You probably heard by now about Oracle Cloud Free Tier
While it sounds good, the only databases that you can use are in fact autonomous databases (which are not interesting for a tech, geeky guy like me).

Of course, you have also "2 virtual machines with 1/8 OCPU and 1 GB memory each." I thought: that’s cool because I could install an Oracle XE 18c database in there and play a bit… But no. The machines will have actually 971MB of RAM which is to low for Oracle XE 18c and you will get an error while trying to install the RPM file.

"[SEVERE] Oracle Database 18c Express Edition requires a minimum of 1GB of physical
memory (RAM).  This system has 971 MB of RAM and does not meet minimum
requirements."

This is due to one piece of script in the RPM file:

# Check and disallow install, if RAM is less than 1 GB
space=`cat /proc/meminfo | grep '^MemTotal' | awk '{print $2}'`
PhyMem=`expr $space / 1024`
swapspace=`free -m | grep Swap | awk '{print $4}'`

if [ $PhyMem -lt 1024 ]
then
        echo "[SEVERE] Oracle Database 18c Express Edition requires a minimum of 1GB of physical
memory (RAM).  This system has $PhyMem MB of RAM and does not meet minimum
requirements."
        echo
        exit 1
fi

You can edit this script with a tool called rpmrebuild, that can be installed from yum repository:

rpmrebuild -e -p /home/opc/oracle-database-xe-18c-1.0-1.x86_64.rpm

I changed the if statement to look like this:

if [ $PhyMem -lt 102 ]
then
        echo "[SEVERE] Oracle Database 18c Express Edition requires a minimum of 1GB of physical
memory (RAM).  This system has $PhyMem MB of RAM and does not meet minimum
requirements."
        echo
        exit 1
fi

After this modification rpmbuild will create a new RPM file (you should do it in screen because it will take quite a long time).
This change will let you install the RPM. Of course, the configure script will fail with an error, but you can either create a database manually or use a backup of your XE database, created previously on your normal virtual machine (this is what I did)

And that’s how you can have on XE database in your Oracle Cloud Free Tier… It will be as slow as Oracle Support… but at least you will have a normal database to play with 😉


Contact us

Database Whisperers sp. z o. o. sp. k.
al. Jerozolimskie 200, 3rd floor, room 342
02-486 Warszawa
NIP: 5272744987
REGON:362524978
+48 508 943 051
+48 661 966 009
info@ora-600.pl

Newsletter Sign up to be updated