Installing Oracle XE 11g r2 on Amazon micro-instance (Oracle Linux 5.4)
Amazon EC2 Micro instances provide 613 MB of memory and support 32-bit/64-bit platforms Linux or Windows. Micro instances price starts at $0.02 per hour for Linux and $0.03 per hour for Windows. Oracle XE 11g release 2 (beta) was launched on April 1st 2011 and it’s available for Linux 64 bit and Windows 32 bit. The new XE increased the max user data from 4GB to 11GB but still only uses a max of 1GB of memory, even if you have more available. Lets get started…
1 – Launch a micro-instance on your AWS Console (I’ve used an OEL5.4-x86_64 ami-e9664c9d instance)
2 – Add swap space, in my case I’ve add a 2GB swapfile (Oracle Database 11gExpress Edition requires 1230 MB of swap space… check yours with “free” command)
[root@ip oracle]$ dd if=/dev/zero of=/swapfile bs=1024 count=2048000 [root@ip oracle]$ mkswap /swapfile [root@ip oracle]$ swapon /swapfile # add the following line to /etc/fstab to enable swap at boot time /swapfile swap swap defaults 0 0
3 – Get Oracle XE 11g (http://www.oracle.com/technetwork/database/express-edition/downloads/index.html) and send it to the server. What I’ve done was download it to my MAC and after that i’ve put the file on my public Dropbox folder. It was instantly!!!… Dropbox is intelligent enought to find that if someone already have this file shared it won’t be uploaded again! It was immediatly available.
4 – At your server download the Oracle XE from your Dropbox (your link may be different) and unzip it.
[root@ip root]$ wget http://dl.dropbox.com/u/123456/linux.x64_11gR2_OracleXE.zip [root@ip root]$ unzip linux.x64_11gR2_OracleXE.zip
5 – Check that you have the required linux programs installed.
[root@ip root]$ yum install glibc make binutils gcc libaio
6 – Install and configure it.
[root@ip root]$ rpm -i oracle-xe-11.2.0-0.5.x86_64.rpm [root@ip root]$ /etc/init.d/oracle-xe configure
Oracle XE 11g r2 sets the ORACLE_HOME to /u01/app/oracle/product/11.2.0/xe and the datafiles, fra, admin dirs complies with the OFA. Take a look:
[root@ip oracle]$ pwd /u01/app/oracle [root@ip oracle]$ ls -lht total 40K drwxrwxr-x 4 oracle oinstall 4.0K Apr 4 16:29 diag drwxr-x--- 4 oracle oinstall 4.0K Apr 4 16:29 admin drwxr-x--- 3 oracle oinstall 4.0K Apr 4 16:29 flash_recovery_area drwxr-xr-x 3 oracle oinstall 4.0K Apr 4 16:29 oradata drwxr-xr-x 3 oracle dba 4.0K Apr 4 16:28 product
7 – Connect to the database with SQLPlus (set environment) and enable APEX remote access (The APEX start page is http://
[root@ip root]$ su - oracle [oracle@ip oracle]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe [oracle@ip oracle]$ export PATH=$PATH:$ORACLE_HOME/bin [oracle@ip oracle]$ export ORACLE_SID=XE [oracle@ip oracle]$ sqlplus "/ as sysdba" Connected to: Oracle Database 11g Express Edition Release 22.214.171.124.0 - 64bit Beta SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
The memory default settings shows that Oracle is running with a small memory footprint… only 160MB… Sweet to run on cheap Micro-instances for development purposes!
SQL> show sga Total System Global Area 162836480 bytes Fixed Size 2224632 bytes Variable Size 96472584 bytes Database Buffers 58720256 bytes Redo Buffers 5419008 bytes
Done! Enjoy it…