Oracle 9i Install Guides

Oracle 9i Database
Oracle 9i Developer Suite

Installation of Oracle 9i Database on Debian GNU/Linux (unstable)

Trying to get Oracle to install on any GNU/Linux system seems to be quite a challenge. Unfortunately, installing it on a Debian GNU/Linux system seems to be even more difficult than normal. And, since Oracle does not officially support Debian, that leaves you out in the cold in regards to getting support from them. (If the price tag for their support didn't already do that...)

So, to fill that void, I've written up this install guide. After suffering through a 7 hour installation that left me with an only partially functional system, I've decided to write up a document on the process so that other people don't have to go through as much hair-pulling as I did. I am indebted to the authors of the pages listed at the bottom of this guide. These two pages had the answers to nearly every single one of my problems. Unfortunately, I didn't find them until nearly 5 hours into my first installation. I have used the information from these two guides and added extra information of my own to make this guide. It is my hope that this guide will make installing Oracle 9i on a Debian GNU/Linux system as painless as possible. So lets get started shall we?

NOTE: I would strongly suggest that, if you have the time, you do the installation twice. Once to see which problems you're going to encounter, and again to get a clean install by preempting the errors. Note that this install is not easy, and it is not for the faint of heart. It is my hope, however, that with this document it will be a much easier task. My first semi-functional installation took ~7 hours, most of it spent tracking down solutions to various problems. Now that I know what to look for, I can get an installation done in about 15 minutes. Hopefully, this document will help you enough to put you much closer to the 15 minute mark than the 7 hour mark. Now, on to the guide.

The system that I'm using is a Debian GNU/Linux Sid (unstable) machine. The machine has an AMD AthlonXP 2000+, with 768 MB DDR RAM, and 90 GB of hard drive space on a RAID0 array controlled by a 3ware 7000-series Escalade board.

For starters, you'll need to have the appropriate software available. You can download Oracle 9i directly from Oracle. The package that I used is the full Oracle 9i distribution. It's 3 disks, coming out to ~1.5 GB all together. Once you've downloaded everything you'll need to use gunzip to decompress the files, and then cpio to get the contents of the archive.

gunzip lnx_920_disk?.cpio.gz
cpio -idmv < lnx_920_disk1.cpio
cpio -idmv < lnx_920_disk2.cpio
cpio -idmv < lnx_920_disk3.cpio
You can burn them all to CD, though if you have the free space, it's probably much faster to just run them from your hard drive.

Before continuing further, I would suggest that you look over the Oracle installation documentation provided on disk 1 (doc/unixdoc/a96167/toc.htm), particularly the pre-install information (doc/unixdoc/a96167/pre.htm#sthref101) and, more specifically, the kernel parameters section. (doc/unixdoc/a96167/pre.htm#CHDHDABJ)

Now that you have all the required packages, it's almost time to run the installer. First, however, you'll need to check which version of gcc you're using. gcc -v will show you which version of gcc you're using. In order to install Oracle you should make sure that you're using gcc 2.95. If you're using 3.0 or later, you'll need to install gcc-2.95 (if it's not already installed) and then modify the /usr/bin/gcc symlink to point to /usr/bin/gcc-2.95.

Oracle also needs version 2.1.30 of the Open Motif libraries. As of the time of this writing, Sid is using 2.2.2. In order to install 2.1.30 it's necessary to download the Woody package for libmotif and install it. Unfortunately, lesstif2 conflicts with libmotif 2.1.30, and along with it goes xpdf. If you're not going to be using any of the GUI tools with Oracle, you can probably do without installing libmotif 2.1.30, though it may cause some problems during installation. If in doubt, go ahead and install the package now, and then remove it after installation is complete if you don't need to use any of the GUI tools.

Now, with that out of the way, you can start the installer. If you're installing from your HD, just type ./runInstaller from Disk1. If you've burned the packages to CD, make sure that you are not in a mounted CD-ROM directory (cd ~) and then run the installer with the full path (e.g. /cdrom/runInstaller or /mnt/cdrom/runInstaller).

Note: Throughout the rest of this guide, I will be referring to directories by their environment names, $ORACLE_HOME and $ORACLE_BASE. When the installer asks you to supply a base directory, we will be dealing with $ORACLE_BASE. When it asks for a home directory, we will be dealing with $ORACLE_HOME. In my case, here are the actual directories I'm using:

$ORACLE_BASE = /usr/local/oracle
$ORACLE_HOME = $ORACLE_BASE/products/Oracle9i
During the installation, you will be given 3 choices. The first is a choice of which product to install. This guide is assuming that you select "Oracle9i Database". Next is the Installation Type. This guide is assuming that "Standard Edition" will be selected. Following that, for Database Configuration the guide assumes a selection of "General Purpose". And finally, the guide will assume a selection of ISO-8590-1 for the locale. You are free to select whichever options you need during installation, but the remainder of these steps are written in the order they are likely to appear during installtion with the selections above.

At this point, the installation should be chugging along happily. So, naturally, it's time to address the plethora of errors that will start appearing.

  1. Error in invoking target install of makefile /usr/local/OracleDB/ctx/lib/ins_ctx.mk
    I've found a few possible workarounds for this, depending on what is causing the error. Open up $ORACLE_HOME/install/make.log and look for the last error and follow the solution as presented below:

  2. When prompted to run root.sh by the installer, you may encounter a problem. By default, root.sh looks for awk in /bin/awk, which does not exist on my system. If necessary, you can either create a symbolic link or edit root.sh and change AWK=/bin/awk to AWK=/usr/bin/awk. Everything else should work just fine.

  3. After the installation is complete, the installer will run some Configuration Tools. The Oracle Database Configuration Assistant will most likely bomb out with a SIGSEGV. I followed these instructions to fix the problem. Here's the abbreviated version:
    Open up $ORACLE_HOME/bin/dbca and change JRE_DIR to point to a local working copy of the JRE. Assuming that you have a relatively recent copy of the JRE, you'll also need to change two lines toward the bottom. $JRE_DIR/bin/jre will now become $JRE_DIR/bin/java.
    Bricklen Anderson (BAnderson@PresiNET.com) has informed me that you can also use a copy of the JRE shipped with Oracle. It is located at $ORACLE_HOME/oracle.swd.jre. Note that on my installation this directory does not exist. This is included as an alternative for those people who do not have a local version of the jre installed and who do have the Oracle supplied one available.

    If you'd like to preempt this problem, while the dialog to run root.sh is still on the screen, make the necessary changes to $ORACLE_HOME/bin/dbca.

  4. Once the Database Configuration Assistant is up and running, you are likely to encounter the following message: ORA-03113: end-of-file on communication channel. UPDATE: Unstable is now using libc6 2.3.2. With this update, this error should no longer occur. The following OLD instructions are only for people who cannot get 2.3.2 for some reason. If you are using 2.3.2 please skip to the next section.

    Unfortunately, there are no simple fixes for this one. Nothing short of patching and recompiling libc6 from scratch. The problem is in a typo in the libc6 source. It should be fixed in 2.3.2, but since Debian unstable is still using 2.3.1, we have to do this the hard way. More details are available here. The instructions that I followed are available here. I've got my own version of the procedure which should address some of the difficulties that I encountered while trying to do this myself the first time:

    1. apt-get source libc6
      This will download and extract the sources for the Debian libc6 package. (You may need to edit your /etc/apt/sources.list to include some source URLs.)
    2. cd glibc-2.3.1
    3. tar -xvvjf glibc-2.3.1.tar.bz2
    4. sensible-editor glibc-2.3.1/elf/dl-runtime.c
      If your editor doesn't automatically make backups, you'll need to make a backup copy of the original file manually. (This guide assumes that the backup copy will be glibc-2.3.1/elf/dl-runtime.c~)
    5. Lines 87 and 182 are what you will need to change. So that this:
      ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info) & 0x7fff];
      will now look like this:
      ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)] & 0x7fff;
    6. LC_ALL=C TZ=UTC0 diff -Naur glibc-2.3.1/elf/dl-runtime.c~ glibc-2.3.1/elf/dl-runtime.c > debian/patches/oracle-dl-runtime.dpatch
      This will create the diff for the patch and place it in a convenient spot.
    7. sensible-editor debian/patches/oracle-dl-runtime.dpatch
      After opening your newly created patch, paste the following to the top:
      #! /bin/sh -e
      
      # DP: Oracle fix for dl-runtime.c, as per http://forums.gentoo.org/viewtopic.php?t=35340
      
      if [ $# -ne 2 ]; then
          echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
          exit 1
      fi
      case "$1" in
          -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
          -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
          *)
              echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
              exit 1
      esac
      exit 0
      The final result should look like this:
      #! /bin/sh -e
      
      # DP: Oracle fix for dl-runtime.c, as per http://forums.gentoo.org/viewtopic.php?t=35340
      
      if [ $# -ne 2 ]; then
          echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
          exit 1
      fi
      case "$1" in
          -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
          -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
          *)
              echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
              exit 1
      esac
      exit 0
      
      --- glibc-2.3.1/elf/dl-runtime.c~       2003-05-22 13:00:29.000000000 +1000
      +++ glibc-2.3.1/elf/dl-runtime.c        2003-05-22 13:00:50.000000000 +1000
      @@ -84,7 +84,7 @@
                {
                  const ElfW(Half) *vernum =
                    (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]);
      -           ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info) & 0x7fff];
      +           ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)] & 0x7fff;
                  const struct r_found_version *version = &l->l_versions[ndx];
      
                  if (version->hash != 0)
      @@ -179,7 +179,7 @@
                    {
                      const ElfW(Half) *vernum =
                        (const void *) D_PTR (l,l_info[VERSYMIDX (DT_VERSYM)]);
      -               ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info) & 0x7fff];
      +               ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)] & 0x7fff;
                      const struct r_found_version *version = &l->l_versions[ndx];
      
                      if (version->hash != 0)
      You can try just pasting this whole chunk into a file, but it didn't work for me. Using that approach, the patch would not apply. The few extra steps outlined above should save you some trouble. This will create a debian patch file that will be executed when you build the package.
    8. echo "oracle-dl-runtime" >> debian/patches/0list
      This will just add 'oracle-dl-runtime' to the list of patches to be applied.
    9. sensible-editor debian/changelog
      Add a changelog entry to the top of this file mentioning what you've done. Besides being good form, this is also where you'll be able to increment the version number for libc6 to make your life easier in the future. I usually add .Thief (Thief = my computer name) to the version numbers. Here is my changelog entry:
      glibc (2.3.1-17.Thief) unstable; urgency=low
       
        * Alex Malinovich 
          - debian/patches/oracle-dl-runtime.dpatch: Fix Oracle issues.
       
       -- Alex Malinovich   Fri, 13 Jun 2003 04:01:24 -0500
    10. dpkg-buildpackage -us -uc
      This is where your machine should start happily buzzing away. If you run into some build depends issues, just install the packages it mentions and then try it again.
      NOTE: You will be here a while. Compilation on my machine (AthlonXP 2000+) took nearly 30 minutes. On a sub-1 GHz CPU, you could possibly be looking at over an hour.
    11. dpkg -i ../libc6_2.3.1-17.Thief_i386.deb
      This will install the newly created libc6 for you. Obviously, you will need to change the filename to match what was actually created on your machine.

  5. If you didn't read through the Oracle install documentation before coming here you may get: ORA-27123: Unable to attach to shared memory segment. In that case, follow the directions below and then restart the dbca from the menu.
      As root:
    1. cd /proc/sys/kernel
    2. echo 100 32000 100 100 > sem
    3. echo 2147483648 > shmmax
    4. echo 4096 > shmmni
    5. echo 2097152 > shmall

    You may want to put this into a startup script to make sure you don't run into problems after rebooting. The above values are the suggested values from the documentation. They work just fine for me, however, YMMV. More precise details are available in your Oracle documentation. On disk 1 of the install set, look at doc/unixdoc/a96167/pre.htm#CHDHDABJ.

  6. The final problem that you might experience is that the Database Configuration Assistant (dbca) doesn't seem to exit properly when called during the installation. It will complete the database installation, ask you to set passwords for the SYS and SYSTEM users, and then disappear. The installer, however, won't realize this and will wait for it to terminate indefinitely.

    This leaves you with two choices. You can either leave the dbca broken for now so that the rest of the tasks can run, or you can wait for the dbca to finish and exit the installer. If you leave dbca broken, then after installation is complete just fix it and run it manually. If you choose to fix it ahead of time, then you will need to run the Agent Configuration Assistant and launch Apache manually.

That should be the end of the errors. In my experience thus far at least, it has been. After this the installation is relatively straightforward. Or at least as straightforward as installing a package of this magnitude can be. All sorts of wonderful DBA related questions which are very likely to confuse you if you're not a DBA. As I'm not a DBA, you're on your own for these. :)

Helpful Links

http://www.puschitz.com/InstallingOracle9i.shtml
A great site with lots of useful info on setting up Oracle. It's technically a Red Hat installation reference, but it contains a great deal of useful information for installing Oracle and troubleshooting the installation.

http://polydistortion.net/monkey/archives/2003/05/22/001730.html#001730
A fantastic writeup for installing Oracle on a Debian system. The vast majority of the information you see in my writeup came directly from here. I have just tried to expand on it where necessary, and include issues that I encountered which original author didn't.


Installation of Oracle 9i Developer Suite on Debian (unstable)

Overall, installation is relatively painless. Launch ./runInstaller and follow the prompts. Total installation time is ~20 minutes. The installer will handle most of the process just fine. There are, however, a few caveats:
  1. Make sure that you are using gcc-2.95. On my system, I had both 2.95 and 3.3 installed. There was a symlink from /usr/bin/gcc-3.3 to /usr/bin/gcc. Change this symlink to point to gcc-2.95 instead. This will alleviate quite a few problems during the installation process.
  2. Download and install libmotif 2.1.30 from your favorite Debian mirror. This is currently the version supplied with Woody. It will conflict with lesstif2 (which in turn is needed for xpdf and xpdf-reader). Unfortunately, I haven't found a way around this yet, so for the time being, no xpdf for me. Without this, you will most likely encounter an error during installation in "ins_reports.mk".
  3. If you still get an ins_reports.mk error after installing libmotif as specified above, check your $ORACLE_HOME/install/make.log and look for an error such as /usr/bin/ld: cannot find -lXt. If you see this error you will also need to install the xlibs-dev package.
  4. At approx 64% into the install process, the following error message appears:
    Error in invoking target install of makefile /usr/local/oracle/plsql/lib/ins_plsql.mk
    To get around this, you will need to edit the file $ORACLE_HOME/bin/genclntsh. Look for a line that reads:
    LD_SELF_CONTAINED="-z defs"
    and change it to read:
    LD_SELF_CONTAINED=""
    Now execute ./genclntsh and wait for it to finish. This will take a few minutes. When it is done you should see a message saying: "Created /usr/local/oracle/lib/libclntst9.a". Now just click "Retry" in the installer's error dialog, and off you go.
Following the installation, a configuration editor will pop up. On my system, the display was rather garbled. The text didn't fit the window at all and, unfortunately, it is impossible to resize the window. While the screens themselves will be quite difficult to read, if you click "Help" and follow along in there you should be able to understand what most of the prompts are.
After this, you're all done! Now get to Developing!
http://www.the-love-shack.net/
Last modified: Mon Aug 11 15:06:26 CDT 2003
8082 visitors since Lucky Friday, June 13th 2003