I’m going to skip the introduction into who Oracle are and what are they’re in my blog. It happens so that I had a seriously struggle with their products during the week. One of these products is Oracle Database 10g Express Edition. The label “Express Edition” stands for a group of products aimed at development and educational work. This package includes a fully functional database. Because of the goals of this edition the software has the following limitations (there’s a good article about that on this address):

  • the server cannot address more than 1Gb of memory;
  • the server can work on a single CPU only;
  • the server runs at most one database per computer (not schema !);
  • the server is limited to 4Gb disk usage;

In a matter of fact, these limitations are not that fatal in the most of the cases.. especially when talking about low-load web applications. These are some of the reasons I had to work with that thing despite my antipathy towards Oracle in general. So, that’s it with the usual bla-bla. I’m going on briefly and step-by-step just like in my notes on the installation:

  1. downloading the packages: FOR DEBIAN ON AMD64: Oracle release their Express Edition database for 32-bit architecture only. That’s why apt-get can’t handle the cases when amd64 is the primary architecture of the operating system. Because of this the download and the installation of the packages should be done manually. Furthermore, the 32-bit glibc6 libraries (the libc-i386 package) should be downloaded, as 32-bit application apparently cannot link to (these?) 64-bit libraries and vice versa.

    FOR RPM-BASED DISTRIBUTIONS: Probably there should be libaio installed. I’m not quite sure about that but I don’t have such a system. I’d be glad if someone who has suffered this share his experience.

    • for DEB-based distibutions w/ apt-get:
      • the following line should be added to /etc/apt/sources.list:

        deb http://oss.oracle.com/debian/ unstable main non-free

      • the following command should be executed:

        apt-get -d libaio oracle-xe

    • for DEB-based distributions w/o apt-get:
      • the libaio package should be download from here;
      • the oracle-xe package should be downloaded from there;
    • for RPM-based distributions:
      • the oracle-xe rpm-package should be downloaded from this addres;
  2. server installation:
    • for DEB-based distributions w/ apt-get:

      apt-get install oracle-xe

    • for DEB-based distributions w/o apt-get:

      dpkg -i libaio_0.3.104-1_i386.deb
      dpkg -i oracle-xe_10.2.0.1-1.1_i386.deb

    • for DEB-based distributions on AMD64:

      apt-get install libc6-i386
      dpkg -i –force-architecture libaio_0.3.104-1_i386.deb
      dpkg -i –force-architecture oracle-xe_10.2.0.1-1.1_i386.deb

    • for RPM-based distributions:

      rpm -ivh oracle-xe-10.2.0.1-1.0.i386.rpm

    NOTE: Ilias brought to my attention in the comments below that a problem exists with the listener unable to run on some distributions (RHEL 4, Ubuntu AMD64 and probably more) due to wrong permissions of the /var/tmp/.oracle (and/or /tmp/oracle) directory. You can take a look at this address for more information. There’re two ways to workaround this problem:

    1. change the user and group of the directory to “oracle” and “dba” respectively:

      chown oracle:dba /var/tmp/.oracle /tmp/.oracle

    2. leave the directory owned by root but change its permissions to 1777 (as it is in Debian):

      chmod 1777 /var/tmp/.oracle /tmp/.oracle

    You’ll also probably have to restart the listener:

    /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/lsnrctl stop
    /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/lsnrctl start

  3. initial configuration of the server:Configuration is now independent of the distribution. Before finishing this operation the server will not be functional . When it starts, it will open two TCP ports - one for the extremely pleasant web administration (Application Express) and another one for communication with the server itself (Database Listener). It’s worth mentioning that, although Database Listener listens on all IP addresses, Application Express binds to 127.0.0.1 only, which makes it a bit unhandy if the database is installed on a remote machine. I found out this can be changed on a later stage using the web administration itself but, until then, I installed a small proggy called “redir” (the Debian package has the same name) which I used to redirect all requests to port 8080 of my public IP to 127.0.0.1. After doing its job it can be easily stopped in order to keep the system secure.
    1. the following command is executed:

      /etc/init.d/oracle-xe configure

    2. a port for Application Express should be selected (it’s 8080 usually);
    3. a port for Database Listener should be selected (by default 1521);
    4. a password for the system users should be picked;
    5. follows an answer to the question wheter or not the database server should be started on boot;
    6. at this point the server is up-and-ready;
    7. it’s a good idea to have the needed environment variables available to Oracle clients. A good choice is to write them down in /etc/profile:

      export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

      or you can simply add the following line:

      . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

    8. it’s also a good idea to put the path to the Oracle libraries in /etc/ld.so.conf in case additional software links to them:

      echo ‘/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib’ >> /etc/ld.so.conf
      /sbin/ldconfig

  4. administration of Oracle Database 10g Express Edition:Once installed the server can be managed with a number of tools:
    • with the cute Application Express which is by default available on the following addres:

      http://127.0.0.1/apex/

      Remote access can be enabled with entering the SQL*Plus console as sysdba and typing:

      EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

    • with the standard console tool SQL*Plus, which is usually located at:

      /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlplus

    • with the graphical tool Oracle SQL Developer;

    NOTE: The SID of the installed database is “XE” by default.

And there was happiness !.. unless an installation of the database client follows….

P.S.: Everybody should feel free to correct any of the mistakes I definitely have… :)

Popularity: 48% [?]