I just spent the better part of a whole weekend
attempting to get Oracle running on my RedHat
Linux 7.2 laptop. In short, it was a big pain.
What bothered me most about the whole ordeal
is the lack of support that I found. I found
quite a few articles on the subject, but none
was clear and concise. Each had part of the
subject covered, but none had the whole picture
or the correct order. I hope what follows will
help the rest of you.
If you want to skip the intro and just see the
actual steps I took, click
here
Allow me to start at the beginning. I am a sysadmin/network
admin supporting Linux & Unix environments.
I am used to working for companies that can
afford their own DBAs and I only venture into
the DB world as far as it relates to working
with a DBA to optimize a server (or to provide
temporary root access while the DBA is doing
something). Recently, my company laid off a
large chunk of it’s employees in an attempt
to stay alive. One of those to go was our DBA,
leaving us with myself and a perl programmer
with some basic database skills, though mostly
on mySQL. I thought it best that I learn a bit
quickly and try to pick up some basic DBA skills.
I started by buying a copy of Osborne Press’
Oracle 8i for Linux Starter Kit by Steve Bobrowski.
I chose this book despite it being close to
three years old because it covers Oracle 8i
(8.1.6) on Linux which is the environment my
company uses.
I started out following the steps laid out in
the first chapter regarding installation of
Oracle on Linux, but didn’t get very far
at all. I set up the oracle user and dba group,
etc, but couldn’t get the installer to
start. Instead all I got was a hung ‘jre’
process taking up 98% of my CPU. I eventually
got this issue resolved, and was able to get
the installer to run and actually bring up the
Oracle Universal Installer. However, during
the ‘linking’ process of the installation
I kept getting errors in various files ending
in ‘.mk’ (make files I am assuming).
I chose to ignore the errors, but when I then
tried to start sqlplus, it errored out with
library errors (I later learned this had to
do with compilation errors with glibc22 when
Oracle was expecting glibc21). I was able to
get around this with some environment variables
in Oracle’s ‘.bash_profile’,
but was now faced with a new problem. When the
installer got to the part where it creates the
initial db, it timed out and hung at 80%. At
this point I decided to try some different Oracle
versions to see if the newer ones had been updated
to handle glibc22. In a nutshell the answer
was no. I tried 8.1.7 and 9i… both failed
with errors during the linking process in various
.mk files. Using the same environment variables
I used for the 8.1.6 install, I was able to
get past the .mk file errors, but experienced
the same hanging 80% of the way into the db
creation. For the record, I believe this problem
doesn’t occur if you choose a custom install
and don’t create an initial database.
However, this is only what I gather from reading
on the web; I didn’t actually try installing
without creating a db. I didn’t experience
the db creation hang when installing 9i since
I hadn’t even gotten past the .mk file
errors at the time.
Below are the steps I took to get Oracle 8.1.6
installed on my machine. The steps themselves
are numbered (1,2,3, etc). Examples are begun
and ended with < and > respectively. Notes
typically follow instructions and are preceeded
with a dash ( - ). Please note that the instructions
below are what worked for me. I have tried to
be as concise as possible so that any reader
of this document could get Oracle 8i or 9i installed
on Linux, but I don’t profess to know
everything. As such you may not need to do everything
I do below, or you may need to make a few additions.
This doc assumes that oracle will be installed
in /usr/oracle. I HIGHLY recommend you read
all the installation steps once prior to starting…
especially the part towards the bottom about
the ‘stubs’ script.
Pre-Installation:
1) Create three groups for Oracle to use
<groupadd sysdba>
<groupadd sysoper>
<groupadd oinstall>
2) Create the Oracle user
<useradd oracle –d /usr/oracle –g
oinstall –G sysdba,sysoper>
3) Set the Oracle user’s password
<passwd oracle>
- (you’ll be prompted to enter the password
twice)
4) Set permissions on Oracle’s home/base
directory
<chmod 755>
5) Create the Oracle base installation directory
<cd /usr>
<mkdir oraInventory>
<chown oracle.oinstall oraInventory>
6) Verify that umask is correct for the Oracle
user
<su - oracle>
<umask>
- You should see 022. If not, check out the
man page for your distribution and learn how
to set the umask to 022
7) Set the environment for the Oracle user
- Oracle documentation says to add the following
to your .bash_profile (or similar file for your
shell)
Unset LANG
- Not sure why this is necessary, only that
many articles recommended it and I believe it
is required for non-English based installs.
Don’t worry though… the Oracle installer
defaults to American English.
DISPLAY=localhost:0.0; export DISPLAY
- Nothing special… just tells X-based
apps to use the local display for output
ORACLE_BASE=/usr/oraInventory; export ORACLE_BASE
- This is unique to each install, but shouldn’t
ever need to be very large
ORACLE_HOME=/usr/oracle; export ORACLE_HOME
- Up to the individual install; most DBAs follow
the typical U01, U02, U03, etc file systems
for Oracle related files with /U01 being the
oracle user’s home directory
ORACLE_SID=oralin; export ORACLE_SID
- My personal… derived from ORAcle for
LINux
PATH=$PATH:$ORACLE_HOME/bin; export PATH
- After much reading and troubleshooting, I
also discovered that the following need to be
added to Oracle’s .bash_profile (or similar
file for your shell)
LD_ASSUME_KERNEL=2.2.5; export LD_ASSUME_KERNEL
- I’m not sure of the technical reasons
behind the LD_ASSUME_KERNEL setting, but I believe
it has something to do with Java. Oracle uses
it’s own JRE, but Netscape documentation
says to make the same setting to the netscape
startup files for Netscape 6 if you encounter
errors and hangs on sites that use java. I had
lots of java-related crashes with NS6 until
I added this setting to my netscape startup
file. Since then I haven’t had an hangs
or other issues.
LDEMULATION=elf_i386_glibc21; export LDEMULATION
GCC_EXEC_PREFIX=/usr/i386-glibc21-linux/lib/gcc-lib;
export GCC_EXEC_PREFIX
- This addition is what fixed the errors in
the .mk files mentioned previously
- If you plan to use any JDBC related stuff,
add the following options now and save yourself
heartache later
CLASSPATH=.:ORACLE_HOME/jdbc/lib/classes111.zip;
export CLASSPATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME/jdbc/lib:$ORACLE_HOME/ctx/lib;
export LD_LIBRARY_PATH
8) Next, make sure that you have the following
packages installed (packages can be found on
the RedHat 7.1 or 7.2 CD #2:
- Compat-libstdc++_6.2-2.9.0.16
- Compat-glibc-6.2-2.1.3.2
- Compat-egcs-c++-6.2-1.1.2.16
- Compat-libs-6.2-3
- Compat-egcs-6.2-1.1.2.16
- Compat-egcs-objc-6.2-1.1.2.16
- Some docs recommended that you also have binutils-2.10.91.0.2-3.
I didn’t personally find this necessary,
but it can’t hurt to remove any newer
version you may have, install binutils-2.10.91.0.2-3,
then go back to the newer version after the
installation is complete.
9) While the directories don’t exist yet,
it’s also good to add two directory entries
to /etc/ld.so.conf and run ldconfig
- Edit /etc/ld.so.conf and add the following
to the bottom of the file:
/usr/oracle/lib (i.e. $ORACLE_HOME/lib)
/usr/oracle/network/lib (i.e. $ORACLE_HOME/network/lib)
</sbin/ldconfig –v>
10) If you are planning to install Oracle 8.1.7,
I have one other recommendation, though I don’t
believe it is a requirement. During the installation
of 8.1.7, the installer will ask for the location
of a local JRE. It defaults to /usr/local/java.
Many of the articles I saw on the internet recommend
that a local java be installed prior to this.
I was able to skip this option and don’t
appear to have suffered any problems, though
installing it can’t hurt and may prohibit
problems. So if you’d like to continue
with this optional steps, instructions are below:
- Download Blackdown’s jdk-1.1.8_v3 from
ftp://metalab.unc.edu/pub/linux/devel/lang/java/blackdown.org/JDK-1.1.8/i386/v3/
- Install Blackdown’s JDK-1.1.8
<tar –xvjf jdk~~~~~.tar.bz2 –C
/urs/local
- Link the jdk to /usr/local/java
<ln –s /usr/local/jdk118_v3 /usr/local/java
11) The final pre-installation step related
to the glibc21 vs glibc22 issues. Basically
the oracle media requires glibc21 to work properly.
Newer versions of Linux, specifically RedHat
7.1 & 7.2 include glibc22. I don’t
pretend to know all the reasons why, but I do
know that Oracle recognizes the problem and
has released a patch to aid in installation.
According to many articles I have read, this
patch will resolve the errors with the .mk files
mentioned earlier in the document as well as
the database hang issue during the database
installation. DO NOT simply try to install glibc21.
I attempted this… first I tried to have
both glibc21 and glibc22 on my system, then
I tried just glibc21. There are too many dependencies
on glibc22 in RedHat 7.1 and newer. Immediately,
Netscape and Gnome failed. If you work in an
X-Windows environment, I highly recommend NOT
trying to downgrade to glibc21 as an alternative.
- Download glibc-2.1.3-stubs.tar.gz from http://download.oracle.com/otn/linux/oracle8i/glibc-2.1.3-stubs.tar.gz
- DO NOT include the location of the extracted
stubs file(s) in the LD_LIBRARY_PATH.
- Extract the stubs archive to $ORACLE_HOME
(/usr/oracle in our example).
<tar –xvzf glibc-2.1.3-stubs.tar.gz
–C /usr/oracle>
*** Please note that you will need a valid
user ID for the Oracle Technology Network (OTN)
before you can download the stubs file. You
can get an UserID for OTN at:
http://otn.oracle.com/admin/account/membership.html
Installation:
1) become oracle with oracle’s environment
variables
<su – oracle>
2) mount the cdrom (this assumes that /etc/fstab
is already set up for all users to access the
CD and that it mounts to /mnt/cdrom)
<mount /mnt/cdrom>
3) from Oracle’s home directory, start
the Oracle installer
</mnt/cdrom/runInstaller>
- If everything has been set up correctly and
depending on the speed of your system, you should
see the Oracle Universal Installer. For me,
this proved to be a critical step that I missed
repeatedly. I kept becoming oracle then cd’ing
into /mnt/cdrom, then running ‘./runInstaller’.
It turns out that need to be oracle in oracle’s
home directory and to run the installer from
the full path as described above.
4) Enter the various information for your installation
and click on next til you get to the summary
screen. If you follow the example I have set
you should enter the following:
- File Locations should be the default: (/mnt/cdrom/stage/products.jar)
- Path: /usr/oracle
- UNIX Group Name: oinstall
- Choose Oracle 8i Enterprise Edition
- Choose Typical installation type
- Database Administrator: sysdba
- Database Operator: sysoper
- Global Database Name: oralin.yourdomain.com
(substitute your domain suffix)
- SID: oralin
- Directory for Database files: /usr/oracle
*** Note that during the configuration process,
Oracle may prompt you with a window telling
you to run something as root. Follow the instructions
provided (which are basically to open a shell,
become root, run a script, and exit the shell
then click on Next or Retry… or whatever
is appropriate).
5) On the summary screen and BEFORE you click
on INSTALL, open another shell and become oracle
<su – oracle>
In the shell, change directory to $ORACLE_HOME
(/usr/oracle).
<cd /usr/oracle>
A quick ‘ls’ should reveal a file
called ‘setup_stubs.sh’.
<ls –als> … <setup_stubs.sh>
The installer shows a progress bar that goes
from 1% to 100%. It hits the 100% after all
the files are copied and BEFORE the files are
linked. However, there is no prompt to continue,
etc after files are copied and before ‘linking’…
the installer simply finishes copying the files,
then moves on to linking. The ‘setup_stubs.sh’
script needs to be run BEFORE linking.
6) With an extra shell open, click on INSTALL
(or Next depending on the version of the Installer).
Carefull watch the progress bar. When it hits
95%, in the other shell, as oracle, run <./setup_stubs.sh>.
This will produce some varied output basically
saying that files were checked and re-linked
(linked to glibc21 not glibc22).
7) When ‘setup_stubs.sh’ is done,
you can close the shell. The Oracle installer
may ask you run another script as root. Do so,
and go on with the installation. The script
will likely be called ‘root.sh’.
Before running the script, as root, edit line
102 and confirm that it reads ‘RMF=”/bin/rm
–f’ “ and NOT ‘RMF=/bin/rm
–f’. If it looks like the latter,
change it to read ‘RMF=”/bin/rm
–rf” ’
8) At this point, Oracle should be installed,
and starter DB should be created, and tools
like sqlplus should work just fine.
In summary, this doc may be a bit of overkill,
but it’s what I had to do to get Oracle
installed. With Oracle’s recent announcement
that they are converting all their backend machines
to the Linux platform, hopefully the installation
processes for Linux will improve. If you find
errors, anomalies, or inconsistencies in this
doc, please feel free to report them to me at
andrew@nccomp.com. I tested this installation
on 4 different machines with Oracle 8.1.6 and
Oracle 8.1.7. I didn’t fully test Oracle
9i, but mostly cause a base install of Oracle
9i on Linux needs 1.3Gb, while Oracle 8i only
needs approx. 500Mb. I have been told that the
9i install will work with the instructions above,
though I have received conflicting information
about whether or not the stubs patch is needed
for a 9i install. Check back and I’m sure
you’ll find that I’ve updated this
to include any relevant 9i installation issues.
Also, if you’re reading this, I will assume
that you are new to Oracle or at least to Oracle
on Linux. Here’s a quick FYI, after an
installation neither the database nor a listener
will start automatically. The default configuration
will also be for dedicated connections, not
multi-threaded connections. I will update this
doc shortly to including system startup/shutdown
scripts and for info on making Oracle run multi-threaded.
Reference Articles - Links:
http://www.learninglinux.com/article.php?sid=44
http://staff.in2.hr/denis/oracle/817install_rh72_en.html
Oracle 8i for Linux Starter Kit by Steve Bobrowski,
Osborne – McGrawHill – Oracle Press
http://www.osborne.com