Alwanza Home How To Linux - Installing Oracle 10g How To Linux
What Oracle "Forgot" to Tell You

"If it were easy, anyone could do it."  That's what my Dad used to tell me when I struggled to understand something and then afterward, when I finally understood it, realized that if it had been explained differently, I would not have had so much trouble.  What he meant by that was, that sometimes the reason for not making something clear and easy is to scare away those who either don't have the intelligence or the education to be in control of something complex; or that some entity wanted to create a cache´ or mystique about some process to increase its pricetag.

Those words kept ringing in my ears as I installed 64bit Oracle 10g on 64bit "Unbreakable Linux" (aka Uninstallable Linux) for the 5th time.  The 5th time was the charm; and now that I have just begun the long and painful process of converting our database from a very old version of Oracle Enterprise on Solaris, to a new version of Oracle Standard Edition on Linux, I thought I would outline some of the very basic things that anyone who wants to install Oracle on Linux should know and won't find (easily) in any available documentation.

The first thing you should know is that there is no ONE Installation Guide that you should be reading.  The official guide will not be accurate; first because there will be some errors in it (a typo here, an uncorrected instruction left over from an earlier version there) and second because it will be out of date before you read it.  The unofficial installation instructions, provided with no guarantees by Oracle Aces will be easier to read and generally more accurate, but not as complete as the official guide, and they won't have the same errors.  They will have different errors.

I found the organization in the official guides to be less than optimal for learning a system, and there are references in the Guides to other documents that supposedly supply supplemental information on a particular topic, but if you actually go to those links and try to find the information that is supposed to be contained there, it isn't.

I read no fewer than 4 Installation Guides (depending on what you count as an Installation Guide, I might have read six) while attempting to install Oracle on Linux; plus an uncountable number of on-line troubleshooting support.  This document is NOT intended to help you avoid reading those documents (sorry), but it is intended as a supplement to help you keep your sanity while doing it.


What Unbreakable (Uninstallable) Linux?

Oracle's own version of Linux that they provide on their own Web site specifically to be used with Oracle installations does not meet expectations.  So far as I can tell, it is RedHat Enterprise and the only change made by Oracle is that RedHat icon is now replaced by a penguin in armour who will do his best (this one is definitely designed to be masculine looking) to win the battle against you.

After installing Unbreakable Linux, even if you select all the right packages, as per documentation, you will need to hand-install several additional RPMs and one or two of them may not even be from the same revision update as your install.  In other words, you may need to find a previous revision update of Unbreakable Linux (off the Oracle website) for one or more of the RPMs required by the Oracle installation.  My successful install required about a dozen additional RPMs and one of them was from a previous revision update.

Save yourself some trouble.  The very first step after completing your install and logging in (as root) for the first time should be to mount each of the disks you used to install Unbreakable Linux and direct the list contents of the RPMs onto your server.  Depending on what media you used to install Unbreakable Linux, what works for you might be slightly different:  this is how I did it:
mkdir /tmp/cdrom /tmp/RPM_LISTS
mount /dev/cdrom /tmp/cdrom
ls /tmp/cdrom/Enterprise/RPMS> /tmp/RPM_LISTS/rpmsdisk1.txt
umount /tmp/cdrom

The RPMs definitely will NOT be accurately documented in the official guide, and they may not be accurately documented in the Ace's guides.  The next update revision will NOT improve the RPM situation.  This is definitely a situation where Oracle has decided that if you do not already know your way around RPMs, you have no business installing an Oracle database.  When your oraInventory/log/Install-log indicates a problem with a "native library" start your Web search.  Use
rpm -q --filesbypkg
and http://www.rpmfind.net to help you guess at which rpm is missing.

If you install x86_64 Linux, you may be very surpised to find that some of the essential RPMs are i386 RPMs.  They are required by the Oracle installer.


Of Course, Everyone Knows That

There are two Oracle home directories.  One is the home directory for the user whose login name is "oracle".  That is the normal definition of a home directory if you are a System Administrator.  The second home directory is called ORACLE_HOME.  That is an environmental variable that you will be responsible for determining and setting and it is where the Oracle database lives. 

These two Oracle homes should NOT be the same directory.  Why?  Because during the Oracle install, errors will be generated if the database needs to write to a directory that does not start out as completely empty.  Even apparently empty home directories (for users) typically contain "invisible" files (that begin with a dot) like .bash_profile and .bashrc, which, by the way, you WILL need to use in order to set environmental variables for the user named oracle who will be doing the install of the Oracle database.

You will need to create some of the directories required by the database as root before you change your identity to oracle to install the database.  If you create directories as root, they will typically auto-generate a lost+found directory.  Remove those for the install.


Can't Hear the Static?

Unless you copy your /etc/sysconfig/network-scripts/ifcfg-eth0 file to your /etc/sysconfig/network-scripts/ifcfg-lo file, Oracle will think that your server does not have a static IP address.  So overwrite that local loopback file.


Shameful Sham

While configuring your kernel parameters there is one value you should be particularly careful about.  That would be shmmax.  The other values have defaults that can be set the same from one server to another; but the value of shmmax is a derived value, proportional to the RAM on your server.  Therefore, if the Install Guides indicate that the value should be "2147483648" or "536870912" ignore that bad advice.  The value of shmmax should be "half the size of physical memory in bytes" or
grep MemTotal /proc/meminfo multiplied by 512


Console Me Not

The Oracle Installation Guides include instructions for running the Universal Installer using X11 forwarding on ssh from a terminal window (probably on a desktop on your LAN) instead of at the server console.  You may think "why bother, I have a perfectly good seat at my console."  I had better results when I ran the Universal Installer from a desktop terminal on my LAN.

The instructions provided by both Oracle and the Oracle Aces are fairly good in this area, although one important point does seem to be omitted:  in addition to ensuring that there are no firewalls blocking your access (TCP port 22) to the server from your desktop (figured that one out without any trouble), and that your sshd is running on the database server, which it should be by default; you will also need not one, but two utilities running on Windows (if your PC is a Windows PC) to make this happen.  One is an ssh client.  The other is an X server program.  There are several software packages available that combine both an X server and ssh; however, there are also ssh programs that can be run from Windows desktops that are lacking X server abilities.  If you set the DISPLAY from your ssh session at your desktop (see instructions below) and then type xclock and your session just hangs and has to be reset with control-c, there is a good chance you have the latter.

The funny thing is that the Install Guides all provide very explicit instructions (in better detail than I have below, even some troubleshooting) as if they expect that this might be your first time running X11 forwarding over ssh; and yet they neglect to tell you that you need 2 Windows utilities to do it.


Keep Alert

Even if every Install Guide you have read indicates that the usual directory for ORACLE_HOME is /u01/app/oracle/product/versionNo, don't be surprised if the default value in the Universal installer is /u01/app/oracle/oracle/product/versionNo.  Either one should work, provided your environmental variable and Universal Installer input agree.  One of the Ace's guides suggests you do not set ORACLE_HOME until after the install; before the install set only ORACLE_BASE.  That way you won't run into conflict.


Get Ready to Do Battle with Mister Armoured Penguin

Don't expect to do it perfectly the first time.  Read several of the install guides.  Take your time the first time you install to modify the scripts I've provided so that they work with your platform and for the version, revision, update (etc) that you are installing.  If you generate errors along the way, try to fix them and complete the Install, so that you'll be better prepared for more of it next time.

As with any Linux install, have your cheatsheet ready with your IP address, Subnet Mask, Gateway, DNS; the partitions you have determined you need.  The Install Guides have a lot to say about how much space should be allocated to /tmp and swap, etc.; I hope you took notes.  You need to know which packages you are going to install; as well as your root password.


Step by Step - After Installing Linux, Preparation for Installing Oracle

The following are provided under the "It worked for me" warranty.  They will require modification to work for you.

All the following need to be run as root, either from a remote terminal or the console monitor, unless otherwise specified.
  1. Add the missing RPMs.  For each of your CDs, make a list of the enclosed RPMs.
    mkdir /tmp/cdrom /tmp/RPM_LISTS
    mount /dev/cdrom /tmp/cdrom
    ls /tmp/cdrom/Enterprise/RPMS> /tmp/RPM_LISTS/rpmsdisk1.txt
    umount /tmp/cdrom

    When you are done with this, you will have 4 files labeled
    rpmsdisk1.txt, rpmsdisk2.txt, rpmsdisk3.txt and rpmsdisk4.txt
    that you will be able to grep inorder to find the RPMs that you need that were omitted from the original install.  Alternatively, you could download all the RPMs into one place where you could retrieve them without having to shuffle through CDs.

    If you cleverly took notes while reading several of the Install Guides, you probably already have a nice long list of the additional RPMs you will need.  Check first to find out if they are already installed on your server.

    I created a LONG script that checked for all my missing RPMs the first time I ran it; and verified the installation the last time I ran it.  Maybe you can create a better one.  Here are a few sample lines from that script:

    # rpm_chech.sh
    # Oracle required RPMs for RedHat Enterprise 4
    echo "RPM List: find RPMs, version listed or later">rpmlist
    echo "">>rpmlist
    echo "Checking first for x86_64 RPMs">>rpmlist
    echo " CHECKING FOR binutils-2.15.92.0.2-10 ">>rpmlist
    rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils >>rpmlist
    rpm -V binutils>>rpmlist
    echo " CHECKING FOR xscreensaver-4.18-5.rhel4.2 ">>rpmlist
    rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' xscreensaver >>rpmlist
    rpm -V xscreensaver >>rpmlist
    echo "">>rpmlist

    echo "The following RPMs need to be installed as both i386 and x86_64">>rpmlist
    echo " CHECKING FOR libaio-0.3.96 ">>rpmlist
    rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libaio >>rpmlist
    rpm -V libaio >>rpmlist
    echo " CHECKING FOR xorg-x11-Mesa-libGL-6.8.2.1.EL.13.20.i386.rpm ">>rpmlist
    rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' xorg-x11-Mesa-libGL >>rpmlist
    rpm -V xorg-x11-Mesa-libGL >>rpmlist
    echo "">>rpmlist

    echo "The following RPMs require i386 versions installed">>rpmlist
    echo " CHECKING FOR expat-1.95.7-4.i386 ">>rpmlist
    rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' expat >>rpmlist
    rpm -V expat >>rpmlist

    BTW, I created this script by putting the list of required RPMs into a spreadsheet and sorting them by whether x86_64 or i386 was required (or both). Then I transferred the list into a plain text file and ran a quick script on that to generate the long rpm_check.sh.

    The benefit of doing it this way is that if I discovered that some of the RPMs in my list were wrong, or misplaced, regenerating the script with corrected values was easy.  Also, if I decided to use a different version of Unbreakable Linux, rewriting the script was just a matter of repopulating the spreadsheet with new RPM names.

    The weakness of this particular script is that the final verification must be done by eye in the rpmlist file.  Although it would be possible to read the file with another script, I prefer the check by eye.

  2. Modify the values of several config files in /etc.  See script:  runMeFixEtc.sh
    Make sure you read the script before running it.  You might want to hand-modify /etc/pam.d/login and make sure you figure out your own value for kernel.shmmax in /etc/sysctl.conf

  3. Make sure your Minimum Values have been properly set in the kernel.  See script:  kernelparam.sh
    Read this file before running it.  Check out /etc/sysctl_conf_original and make sure you aren't setting any values lower than your own system defaults.

  4. Create the user whose login is oracle.  See script:  create_user.sh
    You absolutely need to read this file before running it.  Make sure you modify the script so that it points to the home directory you want to use for oracle, and the ORACLE_HOME you want to use for the database.  Also, before you run this script, be prepared to supply a password for your new user, oracle.

  5. Modify oracle's login script.  The PATH is probably already set in the .bash_profile file.  It would be better to edit this file by hand.  Either verify that your paths are the same as mine or modify accordingly.

    cat >> /opt/oracle/.bash_profile << EOF
    # mount_point = /u01

    ORACLE_BASE=/u01/app/oracle
    export ORACLE_BASE

    # UNCOMMENT THESE AFTER INSTALL (verify them first)

    # ORACLE_HOME=/u01/app/oracle/product/10.2.0
    # export ORACLE_HOME
    # TNS_ADMIN=$ORACLE_HOME/network/admin
    # export TNS_ADMIN
    # DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
    # export DYLD_LIBRARY_PATH
    # LD_LIBRARY_PATH=$ORACLE_HOME/lib
    # export LD_LIBRARY_PATH

    ORACLE_SID=db_1
    export ORACLE_SID

    # PUT YOUR SERVER WITH FULLY QUALIFIED DOMAIN NAME HERE
    ORACLE_HOSTNAME=server.fqdomain.com
    export ORACLE_HOSTNAME

    TEMP=/u01/tmp
    TMPDIR=/u01/tmp
    chmod a+wr /u01/tmp
    export TEMP TMPDIR

    umask 022

    # Oracle requires that the user oracle's home/bin
    # appear in the PATH before /usr/X11R6/bin
    PATH=$HOME/bin:$PATH
    # Comment the above line out AFTER INSTALL and change it to:
    # PATH=$ORACLE_HOME/bin:$PATH

    export PATH
    unset USERNAME

    EOF


  6. Create directories, modify their owners and permissions.  See script:  directoryTweaks.sh
    Make sure you modify the script so that it points to your ORACLE_HOME.

  7. Prepare the Oracle Install files.  Download the Oracle Install files into the directory you have prepared for that purpose.  I used /u01/tmp:
    cd /u01/tmp

    # make sure you can run the Oracle Install as the user oracle.
    chown oracle:oinstall oracle_install_file.cpio.gz
    # or, if you have already ungzipped the file
    chown oracle:oinstall oracle_install_file.cpio

    # Complete the install as the user oracle.
    su - oracle

    # Use one of the following methods to extract the file into the current directory
    zcat oracle_install_file.cpio.gz| cpio -idmv
    # or, if you have already ungzipped the file
    cpio -idmv < oracle_install_file.cpio

  8. Use X11 Forwarding over ssh to install Oracle from a desktop with a terminal into your server.  Maybe.  The install actually runs very smoothly using X11 Forwarding over ssh, that is, provided you CAN run Xll Forwarding over ssh.  If you need an X server on Windows, I would recommmend downloading and installing one.  What Oracle is suggesting you do is sit at a desktop PC (not the server at which you are installing Oracle); open an ssh session, and then run the Oracle installer over that.

    If you can't run X11 Forwarding over ssh, you will have to install Oracle at the console.

      As root, on the console or from a terminal, make sure X11 forwarding is permitted by checking /etc/ssh/ssh_config
      an UNCOMMENTED line in that file should read:
      ForwardX11 yes

      or better
      ForwardX11Trusted yes

      As root at the database server console, add the fully qualified domain name (or ip address) of PC terminal to xhost
      xhost +desktopname.fqdomain.com
      If you don't know your desktop's ip address, open a DOS prompt and type
      ipconfig

      At PC terminal, with SSH Secure Shell Client, open an ssh session and login as the user oracle

      then set the DISPLAY variable, the using IP address of PC terminal
      DISPLAY=192.168.0.23:0.0 ; export DISPLAY

      Run Oracle installer (as user oracle) from desktop terminal
      cd /u01/tmp/database
      ./runInstaller


    • Pay attention to the installer preferences (particularly the ORACLE_HOME path).  If you have gotten this far, you probably already know what kind of database you want to install, etc.  I would like to make one last strong suggestion:  DO install the "sample database".  It is the best way to check after the install that your database can actually run.

    • Finishing up.  By whatever run it takes, when your database has finally installed successfully, you will want to make some changes to the user oracle's .bash_profile file, set some environmental variables, check that the database is actually running, and then shut it down if you want to install additional components.






Links

Oracle Portal All Books
Oracle Documentation
Oracle on Linux
Oracle | Linux Technology Center
Project Downloads: Compatibility - oss.oracle.com
Oracle Site Maps
Oracle MetaLink
home.fnal.gov/~dbox/minos/oracle_patch_README.html
Smiley's Installing Oracle Database 10g Release 2 on Linux x86
PSOUG Home Puget Sound Oracle Users Group
PSOUG Oracle Morgan's Library SQL PL/SQL
Oracle Export Import
Installing Oracle 10g R1,R2 on RHEL 4, 3, 2.1, FC 4, 3, 1, RH 9 (x86 and x86-64 (AMD64/EM64T) - Oracle10g Installation on Red Hat Enterprise Linux AS, Red Hat Fedora Core 4, 3, 1, RedHat 9, install linux 10g oracle







 
To email please see:  contact.cgi if you have any comments or questions about this page.

Authored & created by Meryll Larkin:  5/27/07
Updated:  01/10/10