Wow, I broke my brains over this for the last three days.

I installed the apex listener as mentioned in the manual. It mentions you can use Java 6 Update 20 JDK or later.

However, what they mean is that you should use Java 6 JDK, and you can use update 20 or later.

What I did in my stupidity is to use Java 7. That’s later then Java 6 upd 20 right?

wrong!

If you use Java 7 your listener might work (which was the case in my situation) but connecting to it using SQL Developer is a “no go” ūüôĀ

Be warned.

regards, Richard

In my ongoing quest for freeware in combination with Oracle Apex I gave Oracle Unbreakable linux another try when I heard that you _are_ able to update/upgrade it using yum, without a support identifier.

First we install Oracle Unbreakable Linux here

I opted for the 64 bit version and installed a minimal version in my VirtualBox environment.

  • 2048 Mb memory
  • 32 Gb Harddisk
  • 2 CPU’s
  • 2 Network cards
    • Adapter 1: “NAT”
    • Adapter 2: “Host Only”

When the installer asks for the computername you should make the networkcards connect automatically:

On the bottom left you can select “Configure Network”

Select each of the network cards (eth0 and eth1) and click “Edit”

The trick is in selecting the “Connect automatically” checkbox. check it for both cards.

Continue the rest of the installer normally. Choose the “Minumal” install

After the installation log in as root.

mount /dev/dvd /mnt
cd /mnt/Packages
rpm -ivh wget #(and press the tab-key)
rpm -ivh nano #(and press the tab-key)
cd /etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol6.repo
nano /etc/yum.conf

We now need to enable yum by adding an extra line to the configuration file:

enabled=1

That should do the trick. Test it out by issueing

yum update

<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

</EDIT>

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.

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

...Done
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

Hi,

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>

<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
</EDIT>

declare
  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';
begin
  -- 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';
  else
    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;

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

  commit;

exception
  -- when no acl has been assigned to '*'.
  when no_data_found
    then
      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);
end;

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

<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

</EDIT>

In my effort to create a fully free APEX environment this post is step 1: Install CentOS-5 and Oracle XE 11g.

This series will consist of a number of posts:

This is post 1, covering the basic installation.

Install CentOS-5

In my first attempts to get to this fulle freeware APEX environment I decided to use Ubuntu server with the GNOME desktop. However I found out that most software is delivered in RedHats RPM format. Especially the Oracle HTTP server preferes to be installed on a RedHat compliant system. CentOS is just that.

Just do a clean install CentOS downloaded from their site. I used version 5. But make sure you use the 64 bit version.

After the clean install I installed the VirtualBox extensions:

  1. Choose “Devices” – “Install Guest Additions”
  2. Open a terminal:
    su -
    cd /media/VBOXADDITIONS_4.0.6_71416/
    ./VBoxLinuxAdditions.run

    This installs the VBox additions. We do need a reboot:

    shutdown -r now

Install Oracle XE 11g beta

  1. Download the installer here.
  2. Open a terminal and go to the directory where you downloaded the ZIP
    mkdir OracleXE
    unzip linux.x64_11gR2_OracleXE.zip -d OracleXE
    su -
    cd /home/apex/Downloads/OracleXE
    rpm -ivh oracle-xe-11.2.0-0.5.x86_64.rpm
  3. We’re still Super so we can kick the configuration straight away:
    /etc/init.d/oracle-xe configure

    the installer will ask for a port to run Apex (8080), a port to run the database listener (1521) a password to be used for both SYS and SYSTEM users and whether you’d like to have the database start automatically at system start (y). As a famous dutch beer-commercial states: “now we wait”.

  4. When the installer finishes I put the apex user (the one I use to log in into the system) to the dba group. If we ommit this step we’ll not be able to use SQL*plus as the regular user (in my case this user is called “apex”).
    usermod -G dba apex
  5. Now we need to edit the bashrc file to have the paths and system variables set correctly for everyone on the system.
    gedit /etc/profile

    In the editor at the end of the file add these lines:

    #ORACLE XE 11g Beta
    export ORACLE_SID=XE
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe
    export ORACLE_TERM=xterm
    export NLS_LANG=american_america.utf8
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$ORACLE_HOME/bin:$PATH
  6. Now let’s reboot. We’re finished installing XE !
    shutdown -r now
  7. In the menu go to: Applications – Oracle Database 11g…. – Get Started
    This starts the browser and opens the APEX environment.When the page opens correctly we know that:

    1. The database starts automatically
    2. The EPG is running on port 8080

If you continue to use the EPG, you’re ready.

apex11g-01

if you want to use a different HTTP server you should continue:

You can also use the APEX listener in a stand-alone mode.

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 PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl
sqlplus / as sysdba
startup

## 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
startup
@apxremov
@apexins SYSAUX SYSAUX TEMP /i/
@apxchpwd
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…