Written by Deepak Vohra

 

The debian distributions for Oracle database 10g XE include only the i386 architecture packages and not the amd64 architecture packages. The MultiarchSpec provides for cross-architecture installation of binary packages in the package manager dpkg and the packaging tool apt. In this article we shall install the i386 binaries on a amd64 architecture Ubuntu, which has added support for installing packages from multiple architectures on a single system since the 11.04 version. We shall be using Ubuntu 12.04. This article has the following sections.

 

Finding the Platform Architecture

Installing Oracle database XE i386 binaries

Configuring the Oracle database XE

 

 

Finding the Platform Architecture

 

To find what architecture does a Ubuntu platform support run the command uname –i; for example the supported architecture is x86_64.

 


 

 

The architecture supported by dpkg on a platform may be obtained with the following command.

 

dpkg –print-architecture

 

The foreign architecture supported may be obtained with the following command.

 

dpkg –print-foreign-architecture

 

The output on Ubuntu 12.04 installed on a x86_64 platform shows the architecture to be amd64 and foreign architecture to be i386.

 


 

The foreign architecture supported is stored in the file /etc/dpkg/dpkg.cfg.d/multiarch.

 


Having ascertained that we are installing i386 binaries on a amd64 platform that supports i386 as a foreign architecture, we shall install Oracle database XE i386 binaries next.

 

 

Installing Oracle database XE i386 binaries

 

First, fetch the i386 debian distributions for the oracle-xe-universal and libaio, which oracle-xe-universal has a dependency on using the following command.

 

wget -c http://oss.oracle.com/debian/dists/unstable/main/binary-i386/libaio_0.3.104-1_i386.deb http://oss.oracle.com/debian/dists/unstable/non-free/binary-i386/oracle-xe-universal_10.2.0.1-1.1_i386.deb

 

The libaio:i386 debian distribution gets downloaded.

 


 

The oracle-xe-universal:i386 debian distribution also gets downloaded.

 


 

Next, install the libaio:i386 debian binaries on the amd64 architecture. For the cross-architecture installation we need to include --force-architecture in the dpkg command.

 

sudo dpkg -i --force-architecture libaio_0.3.104-1_i386.deb

 

The libaio:i386 package gets installed.

 


 

Install the oracle-xe-universal:i386 package using the following command.

 

sudo dpkg -i --force-architecture oracle-xe-universal_10.2.0.1-1.1_i386.deb

 

If the system does not meet the minimum requirements for swap space the following message gets output indicating that a minimum swap space of 1024 MB is required.

 


 

Increase the swap space with the following commands.

 

sudo su

swapoff -a

cd /host/ubuntu/disks/

mv swap.disk swap.disk.bak

dd if=/dev/zero of=swap.disk bs=1024 count=1024000

mkswap swap.disk

swapon -a

free –m

 

The output shows that the swap space has been increased.

 


 

Rerun the dpkg command for the oracle-xe-universal:i386 package. The output indicates that oracle-xe-universal:i386 depends on libc6 and bc packages. The oracle-xe-universal:i386 package does not get installed due to the missing dependencies.

 


 

Ubuntu 12.04 on a amd64 platform does provide a libc6 package, but it is for the amd64 architecture. Output information about the libc:amd64 package using the dpkg-query command.

 

dpkg-query –s libc6:amd64

 

The output shows that the Architecture of the package is amd64. MultiArch- aware packages include the Multi-Arch header, which is set to “Same” for the libc6:amd64 package. Multi-Arch: same indicates that the package may be co-installed with a same-name package for a different architecture, libc6:i386 for the libc6:amd64 package, but must not be used to satisfy the dependency of any package of a different architecture from itself. Therefore, we won’t be able to substitute the libc6:i386 with the libc6:amd64 package. If the Multi-Arch were set to “foreign” the libc6:amd64 could have been used instead of libc6:i386, but it is not a feasible provision.

 


 

For correcting the dependencies run the following command twice in a sequence, which builds a dependency tree from the package list and installs the required packages.

 

sudo apt-get –f install

 

The oracle-xe-universal:i386 package dependencies bc:i386 and libc6:i386 are listed to be installed.

 


 

As the output indicates the libc6:i386, bc:i386 dependencies get setup, and the oracle-xe-universal:i386 package gets installed.

 


 

The importance of Multi-Arch: same type package becomes apparent if a same-name package for a different architecture is also required as a dependency for some other package. The bc:i386 package is not multiarch-aware (does not include the Multi-Arch header) as indicated in the package information obtained using the dpkg-query command.

 


 

If the bc:amd64 package were also required and installed, the bc:i386 package would get removed and because the oracle-xe-universal:i386 package has a dependency on the bc:i386 package the Oracle database XE would instance would stop and the oracle-xe-universal:i386 package would also get removed as shown below.

 


 

It should also be noted that we did not install the dependencies libc6:i386 and bc:i386 directly using is the sudo apt-get command for the dependencies as these dependencies have further dependency on other packages. If the libc6:i386 dependency is installed directly, it lists some other dependencies and does not get installed as shown below.

 


 

Similarly, the bc:i386 package has dependency on other packages including the libc6:i386 package.

 


 

It is best to build the dependency tree for the packages and use the sudo apt-get –f install command to install the missing dependencies. If not certain why a package has been installed run the aptitude why command for the package. For example the aptitude why libc6:i386 command outputs the dependence of oracle-xe-universal:i386 on libc6:i386.

 


 

 

 

Configuring the Oracle database XE

 

Having installed the oracle-xe-universal:i386 package and the required dependencies we shall configure the database next. Run the following command to configure the Oracle Database XE.

 

sudo /etc/init.d/oracle-xe configure

 

A prompt for specifying the HTTP port for Oracle Application Express gets displayed. If no value is provided, the default port of 8080 is used. A prompt for specifying the port for the database listener gets displayed with the default port as 1521. Specify the password for the SYS and SYSTEM users. Select “y” for starting database on boot. The Oracle Net Listener gets started. The database gets configured. The database instance gets started.

 


 

Next, specify the environment variables in the .bash_profile, which is opened using a vi editor. Use the following command to open the .bash_profile.

 

$ vi ~/$HOME/.bash_profile

 


 

We shall be using the following environment variables for ORACLE_HOME, PATH, ORACLE_SID and NLS_LANG; other variables may be specified if required.

 

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

export PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_HOME

export ORACLE_SID=XE

export NLS_LANG=’$ORACLE_HOME/bin/nls_lang.sh’

export PATH

 

Specify the environment variables and values as shown below in the vi editor.

 


 

The Application Express may be accessed using url http://127.0.0.1:8080/apex/. Specify the Username and Password and click on Login.

 


 

The Oracle database XE Application Express page gets displayed.

 


 

The configuration files for the Oracle database XE may be listed with the dpkg-query command for oracle-xe-universal:i386 package.

 

 

 

In this article we learnt about installing Oracle database XE i386 binaries on amd64 architecture Ubuntu 12.04 OS. The article illustrates the cross-architecture support for packages, provided by Ubuntu 12.04 (11.04 and later), and the procedure discussed may be used for cross-architecture installation of binaries for another version of Oracle Database also.