UPDATE !: Oracle XE 11g R2 on CentOS 6

<EDIT sept 2, 2011>

Today oracle released the definitive version of Oracle XE 11.2. I haven’t had the opportunity to test that version against my blogs, but I’ll do that shortly. stay tuned


In addendum on my installation series (OraXE11 on CentOS5.5) here my experiences on doing the same on CentOS6

Please be informed that Oracle is not supported on CentOS (let alone CentOS 6) !!

Swap area

When doing the installation on a virgin system (CentOS 6), I discovered that XE now requires a 2Gb swap area. Searching around I found this. It coveres an installation of XE on Ubuntu, but I only used the swap suggestion.

cat /proc/meminfo

That should give you info on the current status.

look at SwapTotal and SwapFree

SwapTotal:       1048564 kB
SwapFree:        1048564 kB

To install a 1 GB swapfile named swapfile in /, for example:

dd if=/dev/zero of=/swapfile bs=1024 count=1048576

This may take a while. After it completes, issue:

mkswap /swapfile
swapon /swapfile
cp /etc/fstab /etc/fstab.orig
echo '/swapfile swap swap defaults 0 0' >> /etc/fstab

You can check it too:

swapon -a
swapon -s

You’re ready to do the actual installation.


First you need to make sure libaio and are installed.

yum install libaio bc

And do the installation

mkdir OracleXE
unzip linux.x64_11gR2_OracleXE.zip -d OracleXE
cd OracleXE
rpm -ivh oracle-xe-11.2.0-0.5.x86_64.rpm

Oracle now needs to get configured:

/etc/init.d/oracle-xe configure

Specify the HTTP port that will be used for Oracle Application Express [8080]: <- ENTER
Specify a port that will be used for the database listener [1521]: <- ENTER
Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of
different passwords for each database account.  This can be done after
initial configuration: TYPE YOUR PASSWORD
Confirm the password: TYPE YOUR PASSWORD
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]: <- ENTER

Starting Oracle Net Listener...Done
Configuring Database...

This takes a looooong while

Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.

You can now continue at step 4 in step 1 of the installation guide

That’s it folks

Opening up email in Apex 4 on Oracle XE 11


I recently installed a new server (mainly by using the installation guide you can find in the menu).

I think this needs an extra step, since I wasn’t able to send out emails from that system using Apex.
In the email-queue it kept saying: ORA-24247: network access denied by access control list (ACL)

A quick “Google”, I ended up here : http://blogs.oracle.com/pankaj/entry/how_to_get_mail_working_with_a

So I needed to execute something (read the blog), I did that as SYS:

<EDIT 12 sep 2011>
Please adjust the name of your apex schema in the code below, by adding / removing the remarks for the t_apex_user variable within the declare section of the code.

<EDIT 29 mar 2013>
I altered the script into a more generic thing. It now takes a few variables:
t_apex_user contains the user for which you need to grant.
t_hostname is the host invloved (this can be ‘*’)
t_new_acl_name holds the name of the ACL in case a new ACL must be created
t_new_acl_descr is the description for this ACL
This makes this into a more generic ACL script, not only for opening up email for the apex user

  t_acl_path varchar2(4000);
  t_acl_id raw(16);
--  t_apex_user varchar2(30) := 'APEX_030200';
--  t_apex_user varchar2(30) := 'APEX_040000';
  t_apex_user varchar2(30)       := 'SPELEN';
  t_hostname  varchar2(2000)     := 'accounts.google.com';
  t_new_acl_name varchar2(2000);
  t_new_acl_descr varchar2(2000) := 'ACL that lets power users to connect to maps.google.com';
  -- Look for the ACL currently assigned to '*' and give t_apex_user
  -- the "connect" privilege if t_apex_user does not have the privilege yet.
  if t_hostname = '*' then
    t_new_acl_name := 'power_users.xml';
    t_new_acl_name := t_hostname || '.xml';
  end if;

  select acl
  into   t_acl_path
  from   dba_network_acls
  where  host = t_hostname
    and  lower_port is null
    and  upper_port is null;

  -- Before checking the privilege, make sure that the ACL is valid
  -- (for example, does not contain stale references to dropped users).
  -- If it does, the following exception will be raised:
  -- ORA-44416: Invalid ACL: Unresolved principal t_apex_user
  -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
  select sys_op_r2o(extractvalue(p.res, '/Resource/XMLRef'))
  into   t_acl_id
  from   xdb.xdb$acl a
  ,      path_view p
  where  extractvalue(p.res, '/Resource/XMLRef') = ref(a)
    and  equals_path(p.res, t_acl_path) = 1;

  if dbms_network_acl_admin.check_privilege(t_acl_path, t_apex_user, 'connect') is null
      dbms_network_acl_admin.add_privilege(t_acl_path, t_apex_user, true, 'connect');
  end if;


  -- when no acl has been assigned to '*'.
  when no_data_found
      dbms_network_acl_admin.create_acl(t_new_acl_name, t_new_acl_descr, t_apex_user, TRUE, 'connect');
      dbms_network_acl_admin.assign_acl(t_new_acl_name, t_hostname);

I had to replace the “FLOWS_030000” by “APEX_040000” in Pankaj’s script. After this everything worked like a charm.

Apex installation notes

These are -some of- the notes I made when installing Oracle Apex 4.0.2 in a RedHat Linux environment (scenario 4 of my previous post).

## Mount folder located in filesystem in VM

[ ~]# su - root
[root@a005 ~]# mkdir /mnt/vmshare
[root@a005 ~]# mount -t vboxsf vmshare /mnt/vmshare

## Wat is mounted?

[root@a ~]# mount
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda3 on /home type ext4 (rw)
/dev/sda5 on /tmp type ext4 (rw)
/dev/sda6 on /var type ext4 (rw)
/dev/sdb1 on /app type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
vmshare on /mnt/vmshare type vboxsf (rw)

## Empty /tmp directory after failed install

[root@a005 ~]# rm -r -f /tmp

## Installation Oracle

sh-4.1$ cd /mnt/vmshare
sh-4.1$ cd database
sh-4.1$ ls
doc install response rpm runInstaller sshsetup stage welcome.html
sh-4.1$ sh runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 80 MB. Actual 448 MB Passed
Checking swap space: must be greater than 150 MB. Actual 1999 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-04-10_10-42-53PM. Please wait ...

## Start SQLPLUS + database

export ORACLE_HOME=/app/oracle/product/rdbms/ora11g
export ORACLE_SID=orcl
sqlplus / as sysdba

## Install APEX 4.0

export APEX_HOME=/app/oracle/product/apx/apx40/
mkdir $APEX_HOME
cp -r -f /mnt/vm/Oracle/apex/apex_4.0.2/* /app/oracle/product/apx/apx40/
cd /app/oracle/product/apx/apx40/apex
sqlplus / as sysdba
alter user APEX_040000 account unlock;
alter user APEX_PUBLIC_USER account unlock;
alter user FLOWS_FILES account unlock;
alter user APEX_PUBLIC_USER identified by password;
alter user APEX_PUBLIC_USER account unlock;
sqlplus / as sysdba
@apex_epg_config /app/oracle/product/apx/apx40

Finally Assign ACL’s using the PL/SQL procedure provided in the Oracle installation guide.
… and test your install…

Installation and configuration

Since Oracle is always advising to use the XE database it seemed only logical to try and see what the possiblities are, and how they compare. For those interested, this post shows the outcome of  my quick survey.

1. Use the download provided by Oracle

a. Install VM (VirtualBox)
b. Import machine
c.  A working environment: enjoy!
– free software
– quick and easy to use with minimal effort
– setup as a training environment complete with tutorial, you can get started immediately…
– Since it is a ready-made environment, you miss out on learning about the technical background stuff
2. Windows install
– Windows OS is familiar to most, and most often used by customers as OS platform for developer machines.
– Windows OS is either expensive, or illegal (though WE don’t do that of course)…
– Oracle can slow down your system, particularly on startup, due to resources needed to startup system and database, memory usage, etc.
3. Linux install (1): Ubuntu
a. Install Ubuntu
b. install packages needed to run Oracle Universal Installer
c. install Oracle Database (XE/Enterprise, depending on your needs and preferences)
d. Install Apex
e. Install Development tools as needed
– free platform
– lots of possibilities to learn (Specifically about Linux installs – if you haven’t had a lot of experience with these yet)
– this particular configuration will not appear on your workplace very often
4. Linux (2): Oracle Ubreakable Linux
a. install Oracle Unbreakable Linux (a RedHat derivative)
b. Install + configure Oracle database (XE/Enterprise, afhankelijk van wat je nodig denkt te hebben)
c. Install missing packages (these are requested by Oracle installer)
d. Install and configure Apex.
e. Install development tools as needed.
This installation scenario resembles many, if not most, of the profession Oracle environments you will encounter
– free platform (though database license required when you are using Enterprise Edition and your setup is be used for production)


– this is NOT a simple scenario.

Oracle 11g on Windows DBConsole does not start

Wow. I have broken my thoughts about this for a loooooong time. In the end stuff can be so simple:

When you get the errormessage that it cannot start the DBConsole do this:

  • Make sure you have the MS loopback adapter installed (remember my previos Blog-entry)
  • Make an entry in your hosts file:
    xx.xx.xx.xx yyyy
    where xx.xx.xx.xx is your fixed IP-number on the MS Loopbackadapter and yyyy is your computrename
  • Restart the service

That should do the trick

Great thanks to http://www.ywema.com/yweblog/2008/09/oracle-11g-dbconsole-en-apex/

Oracle DB on a notebook

If you want to install an Oracle database on a notebook, then it is essential that beforehand you install the MS Loopback adapter. This is a “virtual” network adapter.

After installation assign it a fixed IP-addres ( for example) and you’re ready to install the Oracle Listener and Database instances.

You should not believe people who claim that Oracle doesn’t need it anymore. Maybe Oracle can do without the loopback adapter, but it will prevent a lot of issues that you would need to solve manuallly.