Installing Oracle 8.0.5 on Red Hat Linux 5.x

by Nathan Wallace (April 28, 1999)

Introduction

This document describes how to install Oracle on Red Hat Linux 5.x.

The setup of Oracle is quite difficult. Do not try to install Oracle unless you really have to use it. Solid is much simpler to install and maintain. The best comparison is that Solid is a 2MB download, compared to 140MB for Oracle. This difficulty factor of 70 holds true throughout the installation of Oracle.

These instructions should allow you to get Oracle running in a couple of hours (after you have downloaded the beast). Using the Oracle docs and some other internet resources it took me a week to get this far...

Getting Oracle

  1. Create an place for the download. I use /usr/installs/databases/ora805.

  2. Download the files 805ship[1-7].tar from ftp.oracle.com/pub/www/oracle8/linux.

  3. Extract all the setup files with
        cat 805ship*.tar | tar -zx
    

Getting Ready

  1. If you know nothing about Oracle then some good background information is available from the Oracle Unleashed book.

Setting the Environment

  1. Log in as root.

  2. These instructions are designed to be used in tandem with the Oracle installation instructions. Step through the Oracle instructions as you step through this guide. This guide only outlines the more complicated parts of the official installation instructions. Open the installation guide in Netscape from
        /usr/installs/databases/ora805/unixdoc/index.htm
    

  3. Work your way to the Setting the Environment section.

  4. We are now at the Tasks to Perform as root section.

  5. Configure Linux Kernel for Oracle. Momentary panic as you realise (after 2 hours research) that this means you will have to recompile the kernel.

    If you have source code installed you can go to /usr/src/linux and then run

        cd /usr/src/linux
    	grep SHMMAX `find . -name *.h`
    
    to find the relevant lines in the include files (note the backquotes).

    Breathe a sigh of relief as you realise that the default linux parameters are probably good enough for now.

  6. Create two linux groups called dba and oper. I did this using the User Configuration tool in X windows.

  7. Create a user called oracle whose default group is dba. Again I used the User Configuration tool.

  8. I only have a single disk and I am not worried about an optimal architecture at this stage so I ignored the mount information. Later I found that Oracle requires heaps of disk space and I ran out during the installation. So on one of my many installation attempts I created a new mount point /u01 on my machine.

    First create a new directory /u01. We are already working as root at this time.

        cd /
        mkdir u01
        chown oracle u01
        chgrp dba u01
    

    Now we must mount a hard disk partition under this directory. I did this using the graphical tools. This mount is now an automatic part of your system configuration.

    If you already have enough space somewhere else, hundreds of megabytes, then you can just create a symbolic link for /u01 to that space.

  9. Red Hat already has /usr/local/bin setup.

  10. Now we need to run the oratab script as root. First we must setup the ORACLE_OWNER environment variable. For now we'll do this temporarily with
        ORACLE_OWNER=oracle
        export ORACLE_OWNER
    

    Now run the script. It is OK to continue since ORACLE_OWNER is set.

        cd /usr/installs/databases/ora805/orainst
        oratab.sh
    

  11. Now are now at the tasks to perform as the oracle user section. Open an xterm and change to the oracle user
        su oracle
    

  12. The umask for the oracle account must be set to 022. You can check this with:
        umask
    

    If it is not correct then you need to add a line to your .bash_profile

    umask 022
    

  13. Here are the parameters that I set in /home/oracle/.bash_profile. I found that I needed to logout of X (the root session) and relogin as oracle to get these parameters to come alive:
    # oracle parameters
    ORACLE_BASE=/u01/app/oracle
    ORACLE_HOME=$ORACLE_BASE/product/8.0.5
    LD_LIBRARY_PATH=$ORACLE_HOME/lib
    ORACLE_SID=main
    ORACLE_TERM=386
    PATH=$PATH:$ORACLE_HOME/bin
    TMPDIR=/var/tmp
    export ORACLE_BASE ORACLE_HOME LD_LIBRARY_PATH ORACLE_SID ORACLE_TERM PATH TMPDIR
    umask 022
    

    Check these parameters twice before relying on them. I set export for LD_LIBRARY not LD_LIBRARY_PATH and wasted hours looking for the subsequent linking problem.

    If you have AOLserver started automatically by init then you may like to add the definition of these parameters to that script. Alternatively you can create a wrapper for the AOLserver program (nsd) which sets these variables.

    mpgorkom wrote to tell me that if you add the lines below to the .bash_profile you can avoid the whole installation error we work through later on. I haven't personally tested his solution:

    ORACLE_DOC=$ORACLE_BASE/doc
    export ORACLE_DOC
    

Installing

  1. Start the installation program as the oracle user.
        cd /usr/installs/databases/ora805/orainst
        orainst
    

  2. Choose Custom Install. You have to tab through to the options, press the down arrow to highlight custom and then hit space to select. Tab through to the OK button and hit enter to continue.

  3. Click OK to the two readme files.

  4. We are going to Install, Upgrade or De-Install Software.

  5. Install New Product - Create DB Objects.

  6. The values for ORACLE_BASE and ORACLE_HOME should be:
        ORACLE_BASE: /u01/app/oracle
        ORACLE_HOME: /u01/app/oracle/product/8.0.5
    

  7. Just accept the defaults for the log file locations unless you are doing an OFA compliant installation.

  8. We are Installing from a Staging Area.

  9. The path is wherever you unpacked the Oracle download. Mine is:
        /usr/installs/databases/ora805
    

  10. I set the ORACLE_SID to main.

  11. There was no English/Australian so I had to settle for English/American.

  12. We have to remember where that root.sh file is so we can run it later. Of course, your lucky because this document will do that for you.

  13. Now for the actual installation!

    I selected the following for installation, you should probably do the same. Maniacs who want to install more options can always do so later on. Let's get something working first...

        Client Software 8.0.5.0.0
        Oracle8 Server, Release 8.0.5 Documentation 8.0.5.0
        Oracle8 Standard (RDBMS) 8.0.5.0.0
        PL/SQL 8.0.5.0.0
        SQL*Plus 8.0.5.0.0
    

    Note that there is a problem with the installation of the documentation. It will cause the installation to bark at us later on. If you like to play safety first then you probably shouldn't install the documentation right now. Otherwise I have included a work around later in this document.

  14. Hit tab to move to the install button and press enter.

  15. The default value for ULIMIT is acceptable.

  16. Use dba as the group.

  17. You have a choice for the OSOPER group. You can use the dba group, or if you created it above the oper group. If you choose the oper group then Oracle will have to relink the executables.

  18. Use a File System Based Database.

  19. If you are aiming for OFA compliance then you do want three mount points. Since we are wimps we are using just the single mount point, so we have to choose No.

  20. /u01 is our single mount point.

  21. I used the US7ASCII character set to create the database.

  22. I used US7ASCII as the National Character Set for the database.

  23. Choose the password for the database SYSTEM user. Confirm it.

  24. Choose the password for the database SYS user. Confirm it.

  25. The last thing I want on my development machine is more passwords so I didn't create database passwords for dba and operator.

  26. Choose the password for the TNS listener. Confirm it.

  27. I decided to answer No to configuring the Multi-Threaded Server and automatically starting the SQL*Net listener.

  28. The next three pages of default control files and sizes are fine. Accept them all.

  29. I decided that the SQL*Plus Help facility would be useful.

  30. Load the demo tables as they will help us check our installation later.

  31. My ORACLE_DOC path is:
        /u01/app/oracle/doc
    

  32. HTML documentation is probably the simplest.

  33. Now we are copying files! This takes a long time... but since we are installing the documentation it will blow up in the middle, so keep an eye on it.

  34. The doc install barfs with the error:
    A write error occurred while trying to copy
    '/usr/installs/databases/ora805/unixdoc/server.805/install/lnx_server.805
    to
    '/u01/app/oracle/product/8.0.5/doc/server.805/install/lnx_server.805
    (No such file or directory.)
    

    If we take a look ourselves we can see that the /u01/app/oracle/product/8.0.5/doc directory is empty! Log in to another xterm as the oracle user and help out by creating the directories.

        cd /u01/app/oracle/product/8.0.5/doc
        mkdir server.805
        cd server.805
        mkdir install
    

    Now hit Retry on the installation. It should continue as normal.

  35. The requested action has been performed for selected products. Great! You have Oracle installed.

  36. Check that all the components you selected for installation are now listed as being installed. Once you are satisfied you can Exit the installer. If you are feeling braver now, you can install more components before exiting the installer.

  37. The Oracle installer prints its status on exit. If you don't get the message below then you are in trouble and should probably start again.
    Result: Success
    

  38. As I understand it the Oracle database is actually running at this stage. We cannot use it however until we have configured a few more parameters.

Making Oracle Work

  1. You have the actual Oracle files installed but there are still a few steps to go before you can use Oracle. We are now up to Configuring the Oracle System in the manual.

  2. Now we can run the root.sh script. Note that the script does not have execute permissions so we have to use sh unless we want to chmod the file.
        cd /u01/app/oracle/product/8.0.5/orainst
        sh root.sh
    

  3. The root user needs to have access to all of the Oracle environment variables before she can run root.sh. I am the only one to use my development machine so I just added all of the environment variables outlined above (ORACLE_HOME, etc) to the /etc/profile. That way they are available to all users. Alternatively you can just add them to the root users .bash_profile. I added the following to /etc/profile:
    #
    # oracle
    #
    
    ORACLE_BASE=/u01/app/oracle
    ORACLE_HOME=$ORACLE_BASE/product/8.0.5
    LD_LIBRARY_PATH=$ORACLE_HOME/lib
    ORACLE_SID=main
    ORACLE_TERM=386
    PATH=$PATH:$ORACLE_HOME/bin
    TMPDIR=/var/tmp
    export ORACLE_BASE ORACLE_HOME LD_LIBRARY_PATH ORACLE_SID ORACLE_TERM PATH TMPDIR
    
    ORAENV_ASK=NO
    . /usr/local/bin/oraenv
    

    The oraenv program is a simple way to set up the same environment for all oracle users if you have this setup information scattered in all of their respective .profile's.

  4. You will need to log out and log back in as root to see the effects of these changes.

  5. I accepted these settings:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/app/oracle/product/8.0.5
        ORACLE_SID=   main
    

  6. The full pathname of the local bin directory is:
        /usr/local/bin
    

  7. It does not matter that the ORACLE_HOME directory is not the oracle home directory. So it's OK to continue.

  8. Now we are ready to connect to the server! We need to enter in the views and packages necessary for replication. This is done using SQL*Plus. Note that we are still working as root. The catrep.sql file (which we will run) is in the admin directory. Here is the sequence:
        cd ..
        cd rdbms/admin
        sqlplus
    
    SQL*Plus: Release 8.0.5.0.0 - Production on Wed Mar 10 16:14:0 1999
    
    (c) Copyright 1998 Oracle Corporation.  All rights reserved.
    
    Enter user-name: sys
    Enter password: 
    
    Connected to:
    Oracle8 Release 8.0.5.0.0 - Production
    PL/SQL Release 8.0.5.0.0 - Production
    
    SQL> help topics
    
    ----- long list of help topics will be printed
    
    SQL> @catrep.sql
    
    ----- long list of status messages, don't worry about the errors
    
    Commit complete.
    
    SQL> exit
    Disconnected from Oracle8 Release 8.0.5.0.0 - Production
    PL/SQL Release 8.0.5.0.0 - Production
    

  9. Check that your /etc/oratab file looks like this:
    #
    #  This file is used by ORACLE utilities.  It is created by root.sh
    #  and updated by the Oracle8 and SQL*Net install procedures.
    #
    #  A colon, ':', is used as the field terminator.  A new line terminates
    #  the entry.  Lines beginning with a pound sign, '#', are comments.
    #
    #  Entries are of the form:
    #      $ORACLE_SID:$ORACLE_HOME:<N|Y>:
    #
    #  The first and second fields are the system identifier and home
    #  directory of the database respectively.  The third field indicates
    #  to the dbstart utility that the database should, "Y", or should not,
    #  "N", be brought up at system boot time.
    #
    #  Multiple entries with the same $ORACLE_SID are not allowed.
    #
    #
    main:/u01/app/oracle/product/8.0.5:N
    

  10. Log out of the root account and log back in as Oracle. Don't shut down the machine since the Oracle database is still running.

  11. Now we'll shutdown the database, just to introduce the svrmgrl program. Here is the procedure:
        svrmgrl
    
    Oracle Server Manager Release 3.0.5.0.0 - Production
    
    (c) Copyright 1997, Oracle Corporation.  All Rights Reserved.
    
    Oracle8 Release 8.0.5.0.0 - Production
    PL/SQL Release 8.0.5.0.0 - Production
    
    SVRMGR> help
    The following are SIMPLIFIED syntax descriptions. For complete syntax
    descriptions, please refer to the Oracle Server Manager User's Guide.
    
    STARTUP      [DBA] [FORCE] [PFILE=filespec] [EXCLUSIVE | SHARED]
                 [MOUNT dbname | OPEN dbname] [NOMOUNT]
    
    SHUTDOWN     [NORMAL | IMMEDIATE | ABORT]
    
    MONITOR      For graphical modes only, bring up a monitor
    
    ARCHIVE LOG  [START] [STOP] [LIST] [NEXT] [<n>] [ALL] ['destination']
    
    RECOVER      { [DATABASE [MANUAL] ] | [TABLESPACE ts-name [,tsname]] }
    
    CONNECT      [username [/password] ] [INTERNAL] ['@'instance-spec]
    DISCONNECT
    
    SET          options: INSTANCE, ECHO, TERMOUT, TIMING, NUMWIDTH, CHARWIDTH
    SHOW         LONGWIDTH, DATEWIDTH, AUTOPRINT and for SHOW: ALL, SPOOL
    
    EXIT
    REM
                 SQL statements can also be executed.
    SVRMGR> connect internal
    Connected.
    SVRMGR> shutdown 
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SVRMGR> exit 
    Server Manager complete.
    

  12. If you want to start up the database just use svrmgrl again. Do this now.
        svrmgrl
    
    Oracle Server Manager Release 3.0.5.0.0 - Production
    
    (c) Copyright 1997, Oracle Corporation.  All Rights Reserved.
    
    Oracle8 Release 8.0.5.0.0 - Production
    PL/SQL Release 8.0.5.0.0 - Production
    
    SVRMGR> connect internal
    Connected.
    SVRMGR> startup
    ORACLE instance started.
    Total System Global Area                          4754704 bytes
    Fixed Size                                          48400 bytes
    Variable Size                                     4222976 bytes
    Database Buffers                                   409600 bytes
    Redo Buffers                                        73728 bytes
    Database mounted.
    Database opened.
    SVRMGR> exit
    Server Manager complete.
    

  13. Now it is time to test our installation with a real example. We have the database running, and we have the demo tables that we installed with SQL*Plus.
        sqlplus
    
    SQL*Plus: Release 8.0.5.0.0 - Production on Wed Mar 10 17:33:48 1999
    
    (c) Copyright 1998 Oracle Corporation.  All rights reserved.
    
    Enter user-name: scott
    Enter password: tiger
    
    Connected to:
    Oracle8 Release 8.0.5.0.0 - Production
    PL/SQL Release 8.0.5.0.0 - Production
    
    SQL> select * from emp;
         EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
    ---------- ---------- --------- ---------- --------- ---------- ----------
        DEPTNO
    ----------
          7369 SMITH      CLERK	      7902 17-DEC-80	    800
    	20
    
          7499 ALLEN      SALESMAN	      7698 20-FEB-81	   1600        300
    	30
    
          7521 WARD       SALESMAN	      7698 22-FEB-81	   1250        500
    	30
    
    
         EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
    ---------- ---------- --------- ---------- --------- ---------- ----------
        DEPTNO
    ----------
          7566 JONES      MANAGER	      7839 02-APR-81	   2975
    	20
    
          7654 MARTIN     SALESMAN	      7698 28-SEP-81	   1250       1400
    	30
    
          7698 BLAKE      MANAGER	      7839 01-MAY-81	   2850
    	30
    
    
         EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
    ---------- ---------- --------- ---------- --------- ---------- ----------
        DEPTNO
    ----------
          7782 CLARK      MANAGER	      7839 09-JUN-81	   2450
    	10
    
          7788 SCOTT      ANALYST	      7566 09-DEC-82	   3000
    	20
    
          7839 KING       PRESIDENT 	   17-NOV-81	   5000
    	10
    
    
         EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
    ---------- ---------- --------- ---------- --------- ---------- ----------
        DEPTNO
    ----------
          7844 TURNER     SALESMAN	      7698 08-SEP-81	   1500 	 0
    	30
    
          7876 ADAMS      CLERK	      7788 12-JAN-83	   1100
    	20
    
          7900 JAMES      CLERK	      7698 03-DEC-81	    950
    	30
    
    
         EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
    ---------- ---------- --------- ---------- --------- ---------- ----------
        DEPTNO
    ----------
          7902 FORD       ANALYST	      7566 03-DEC-81	   3000
    	20
    
          7934 MILLER     CLERK	      7782 23-JAN-82	   1300
    	10
    
    
    14 rows selected.
    
    SQL> exit
    Disconnected from Oracle8 Release 8.0.5.0.0 - Production
    PL/SQL Release 8.0.5.0.0 - Production
    

    Congratulations! You have a working Oracle installation.

Making Oracle Start Automatically

This section is optional. You may feel more comfortable starting and stopping Oracle manually. It was written with help from Ken Mayer.
  1. Open an xterm window and log in as root
        su
    

  2. Change to the runlevel configuration directory.
        cd /etc/rc.d/init.d
    

  3. Create a file called dbora that contains script below. You might find it easier to just download it (link removed).
    #!/bin/sh
    #
    
    # Source function library.
    . /etc/rc.d/init.d/functions
    
    # Source networking configuration.
    . /etc/sysconfig/network
    
    ORA_HOME=/u01/app/oracle/product/8.0.5
    ORA_OWNER=oracle
    
    if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]; then
            echo "Oracle startup: cannot start"
            exit
    fi
    
    # See how we were called.
    case "$1" in
      start)
            # Start daemons.
            echo -n "Starting Oracle: "
            su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &
            echo
            touch /var/lock/subsys/dbora
            ;;
      stop)
            # Stop daemons.
            echo -n "Shutting down Oracle: "
            su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
            echo
            rm -f /var/lock/subsys/dbora
            ;;
      restart)
            $0 stop
            $0 start
            ;;
      status)
            ;;
      *)
            echo "Usage: dbora {start|stop|restart|status}"
            exit 1
    esac
    
    exit 0
    

  4. Make the script executable with:
        chmod 755 dbora
    

  5. That script can now be used by a number of different run levels. Different run levels are used for starting, rebooting and so on. The script is initiated in the different run levels by creating links to it from the appropriate directories.

    The link has a S (start) or K (kill) as its first letter. The next 2 characters in the name are a number which is used to determine the order in which the services are started and shut down. Oracle should be one of the last things started (high number eg: 95) and one of the first things shut down (low number eg: 12).

  6. We have to add a start up to run level 3.
        cd ..
        cd rc3.d
        ln -s ../init.d/dbora S95dbora
    

  7. No we need to add shut down commands to levels 0, 1 and 6.
        cd ..
        cd rc0.d
        ln -s ../init.d/dbora K12dbora
        cd rc1.d
        ln -s ../init.d/dbora K12dbora
        cd rc6.d
        ln -s ../init.d/dbora K12dbora
    

  8. Finished! Oracle should now automatically start up and shut down.

Using Oracle from AOLserver

These instructions are not complete. They are just recommended steps.
  1. We have to set up the database driver in AOLserver. This driver enables the AOLserver ns_db API to communicate with Oracle. The first step is to get the Oracle database driver for AOLserver from ArsDigita installed. You have to compile it.

  2. Go into Setup Database Drivers page. Click Add Database Driver. Give the driver a name, eg: oracle, and tell AOLserver to use ora8.so. This file should be residing in the default /home/nsadmin/AOLserver/bin directory.

  3. Return to the Standard Setup Area. Go to the Database Pools page. Click Add Database Pool. A database pool is a way for AOLserver to keep a number of persistant connections to the database. These connections can then be allocated to requesting threads as required. The connections do not have to be opened and closed every time we want to perform an operation on the database.

  4. Give the pool a suitable name and description, eg: main and Main. Click Add.

  5. Select the Oracle driver that you created earlier (eg: oracle). The datasource should be empty. Enter the user name and password that will be used to access the database.