<?xml version='1.0' ?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
               "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % myvars SYSTEM "../variables.ent">
%myvars;
]>
<sect1 id="oracle">
  <title>Install Oracle 8.1.7</title>

  <authorblurb>
	<para>By <ulink url="mailto:vinod@kurup.com">Vinod Kurup</ulink></para>
  </authorblurb>

  <para>
    If you are installing PostGreSQL instead of Oracle, skip this section.
  </para>
  <para>
    OpenACS &version; will install with Oracle 9i but has not been extensively tested so may still have bugs or tuning issues.  See <ulink url="http://www.piskorski.com/docs/oracle.html">Andrew Piskorski's Oracle 9i notes</ulink> for guidance.
  </para>
  
  <para>
      This installation guide attempts to present all of the information necessary to complete an OpenACS installation.  We try hard to make all of the steps possible in one pass, rather than having a step which amounts to "go away and develop a profound understanding of software X and then come back and, in 99% of all cases, type these two lines."  The exception to our rule is Oracle production systems.  This page describes a set of steps to get a working Oracle development server, but it is <emphasis role="strong">unsuitable for production systems</emphasis>.  If you will be using OpenACS on Oracle in a production environment, you will experience many problems unless you develop a basic understanding of Oracle which is outside the scope of this document.  T
    </para>
       
    <para>
      
      This document assumes that you'll be installing Oracle on the same
      box as AOLserver. For more details on a remote Oracle installation,
      see Daryl Biberdorf's <ulink
      url="http://openacs.org/new-file-storage/one-file?file_id=273">document</ulink>.
      
    </para>
    <para>
      
    Useful links to find help on how to set up Oracle under Linux are:</para>
    <itemizedlist>
      <listitem>
        
        
        <para><ulink url="http://dizwell.com/html/oracle_on_linux.html">Dizwell - Howard
        Roger's company - on Oracle on Linux</ulink></para>
      </listitem>
      <listitem>
        <para><ulink url="http://puschitz.com/">Werner Puschitz - Oracle on Red Hat Linux</ulink></para>
      </listitem>
      <listitem>
        
        <para><ulink url="http://www.suse.com/us/business/certifications/certified_software/oracle/">SuSE/Oracle Support matrix</ulink></para>
      </listitem>
    </itemizedlist>
  <sect2 id="install-oracle-getit" xreflabel="Acquire Oracle">
	<title>Acquire Oracle</title>

    <para>
      Production Oracle systems should run on certified platforms.  Follow the
      <ulink
      url="http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&amp;p_id=223718.1">metalink
      note 223718.1</ulink>to find certified platforms. If you don't have
      metalink access, take a look at the Oracle on Linux FAQ: <ulink
      url="http://otn.oracle.com/tech/linux/htdocs/linux_techsupp_faq.html#Linux_Distributions">Which
      Linux Distributions Are Directly Supported By Oracle?</ulink>. In summary,
      free and inexpensive Linux distributions are not certified.
    </para>

    <para>
      If you don't have an account at <ulink url="http://otn.oracle.com">OTN</ulink>
      get one: you can download the Oracle software from the <ulink
      url="http://otn.oracle.com/software/products/database/oracle10g/index.html">
      Oracle Downloads</ulink> page. It is also get the CDs shipped to you for
      a nominal fee from the <ulink
      url="http://oraclestore.oracle.com/OA_HTML/ibeCCtdMinisites.jsp?language=US">Oracle
      Store</ulink>.
    </para>


    <para>
      Each Oracle release comes with extensive and usually quite well-written
    documentation. Your first step should be to thoroughly read the release
    notes for your operating system and your Oracle version. Find the docs
    here:</para>

        <itemizedlist>
          <listitem>
            <para>
          <ulink
          url="http://otn.oracle.com/documentation/oracle8i.html">Oracle 8i
          Release Documentation</ulink></para>
          </listitem>

          <listitem>
            <para>
              <ulink
          url="http://otn.oracle.com/documentation/oracle9i.html">Oracle 9i Release Documentation</ulink>
            </para>
          </listitem>
          <listitem>
            <para>
          <ulink
          url="http://otn.oracle.com/documentation/database10g.html">Oracle
          10g Release Documentation</ulink></para>
          </listitem>
        </itemizedlist>
        
 <para> It is generally useful to run a particular Oracle version with its
    latest patchset. At the time of writing these were 8.1.7.4 and 9.2.0.5,
    both of which are considered to be very stable.
    </para>

    <para> 
      To be able to download a patchset, you need a (to-pay-for) account on <ulink
      url="metalink.oracle.com">Metalink</ulink>. You may find the appropriate
      patchset by following <ulink
      url="http://openacs.org/forums/message-view?message_id=33004">Andrew's
      suggestion</ulink>.
    </para>

</sect2>

  <sect2 id="install-oracle-keepinmind">
    <title>Things to Keep in Mind</title>

    <para>
      Oracle is very well-documented software, the <ulink
      url="http://tahiti.oracle.com">online documentation</ulink> comes with
      printable PDFs and full-text search. Altogether there is more than
      20.000 pages of documentation, so do not expect to understand Oracle
      within in a few hours. The best starting pointing into Oracle is the
      Concepts book. Here's the <ulink
      url="http://otn.oracle.com/pls/tahiti/tahiti.to_toc?pathname=server.817%2Fa76965%2Ftoc.htm&amp;remark=docindex">8i
      version</ulink> and the <ulink
      url="http://otn.oracle.com/pls/db92/db92.to_toc?pathname=server.920%2Fa96524%2Ftoc.htm&amp;remark=docindex">9.2
      version</ulink>.
    </para>


    <para>
      To give you an idea of how configurable Oracle is and how much thought
      you may need to put into buying the proper hardware and creating a sane
      setup, you should thoroughly read Cary Millsap's <ulink
      url="http://www.miracleas.dk/BAARF/0.Millsap1996.08.21-VLDB.pdf">Configuring
      Oracle Server for VLDB</ulink> and the <ulink
      url="http://download-west.oracle.com/docs/html/A97297_01/appg_ofa.htm#sthref787">Optimal
      Flexible Architecture</ulink> standard.
    </para>


    <para>
      Throughout these instructions, we will refer to a number of
      configurable settings and advise certain defaults. With the exception
      of passwords, we advise you to follow these defaults unless you know
      what you are doing.  Subsequent documents will expect that you used
      the defaults, so a change made here will necessitate further changes
      later. For a guide to the defaults, please see <xref
      linkend="install-oracle-defaults"/>.

    </para>

<para>
      In order for OpenACS to work properly you need to set the environment
      appropriately.
</para>
            <programlisting>
export ORACLE_BASE=/ora8/m01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/8.1.7
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_SID=ora8
export ORACLE_TERM=vt100
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

umask 022</programlisting>

        <programlisting>
open_cursors = 500</programlisting>
        <programlisting>
nls_date_format = &quot;YYYY-MM-DD&quot;</programlisting>


    <para>

      For additional resources/documentation, please see this <ulink
      url="http://openacs.org/forums/message-view?message_id=28829">thread</ulink>
      and <ulink
      url="http://openacs.org/forums/message-view?message_id=67108">Andrew
      Piskorski's mini-guide</ulink>.

    </para>

  </sect2>

  <sect2 id="install-oracle-preinstall">
    <title>Pre-Installation Tasks</title>

    <para>

      Though Oracle 8.1.7 has an automated installer, we still need to
      perform several manual, administrative tasks before we can launch
      it. You must perform all of these steps as the
      <computeroutput>root</computeroutput> user. We recommend entering the
      X window system as a normal user and then doing a <computeroutput>su
      -</computeroutput>. This command gives you full root access.

    </para>

    <itemizedlist>

      <listitem><para>

          Login as a non-root user and start X by typing
          <computeroutput>startx</computeroutput>
          
          <programlisting>
[joeuser ~]$ startx</programlisting>

        </para></listitem>

      <listitem><para>

          Open a terminal window type and login as root 

          <programlisting>
[joeuser ~]$ su -
Password: ***********
[root ~]#</programlisting>

        </para></listitem>

      <listitem><para>

          Create and setup the <computeroutput>oracle</computeroutput>
          group and <computeroutput>oracle</computeroutput> account

        </para>

        <para>

          We need to create a user <computeroutput>oracle</computeroutput>,
          which is used to install the product, as well as starting and
          stopping the database.

        </para>

        <programlisting>
[root ~]# groupadd dba
[root ~]# groupadd oinstall
[root ~]# groupadd oracle
[root ~]# useradd -g dba -G oinstall,oracle -m oracle
[root ~]# passwd oracle</programlisting>

        <para>

          You will be prompted for the New Password and Confirmation of
          that password.

        </para>
      </listitem>

      <listitem><para> 

          Setup the installation location for Oracle. While Oracle can
          reside in a variety of places in the file system, OpenACS has
          adopted <computeroutput>/ora8</computeroutput> as the base
          directory.

        </para>

        <para>

          <emphasis role="strong">Note:</emphasis> the Oracle install needs
          about 1 GB free on <computeroutput>/ora8</computeroutput> to
          install successfully.

        </para>

        <programlisting>
[root ~]# mkdir /ora8
root:/ora8# cd /ora8
root:/ora8# mkdir -p m01 m02 m03/oradata/ora8
root:/ora8# chown -R oracle.dba /ora8
root:/ora8# exit</programlisting>
      </listitem>

      <listitem><para>

          Set up the <computeroutput>oracle</computeroutput> user's
          environment

        </para>

        <itemizedlist>
          <listitem><para> 

              Log in as the user
              <computeroutput>oracle</computeroutput> by typing the
              following:

            </para>

            <programlisting>
[joeuser ~]$ su - oracle
Password: ********</programlisting>
          </listitem>

          <listitem><para>

              Use a text editor to edit the
              <computeroutput>.bash_profile</computeroutput> file in the
              <computeroutput>oracle</computeroutput> account home
              directory. 

            </para>

            <programlisting>
[oracle ~]$ emacs .bash_profile</programlisting>

            <para>

              You may get this error trying to start emacs: 

            </para>

            <programlisting>
Xlib: connection to &quot;:0.0&quot; refused by server
Xlib: Client is not authorized to connect to Server
emacs: Cannot connect to X server :0.
Check the DISPLAY environment variable or use `-d&#39;.
Also use the `xhost&#39; program to verify that it is set to permit
connections from your machine.</programlisting>

            <para>

              If so, open a new terminal window and do the following:

            </para>

            <programlisting>
[joeuser ~]$ xhost +localhost</programlisting>

            <para>

              Now, back in the oracle terminal:

            </para>

            <programlisting>
[oracle ~]$ export DISPLAY=localhost:0.0
[oracle ~]$ emacs .bash_profile</programlisting>

            <para>            

              Try this procedure anytime you get an Xlib connection refused
              error.

            </para></listitem>

          <listitem><para> 

              Add the following lines (substituting your
              Oracle version number as needed) to
              <computeroutput>.bash_profile</computeroutput>:

            </para>

            <programlisting>
export ORACLE_BASE=/ora8/m01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/8.1.7
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_SID=ora8
export ORACLE_TERM=vt100
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

umask 022</programlisting>

            <para>

              Save the file by typing <computeroutput>CTRL-X
                CTRL-S</computeroutput> and then exit by typing
                <computeroutput>CTRL-X
                CTRL-C</computeroutput>. Alternatively, use the menus.

            </para>
          </listitem>
        </itemizedlist>

        <para>

          Make sure that you do <emphasis role="strong">not</emphasis> add
          any lines like the following

        </para>

        <programlisting>
# NLS_LANG=american
# export NLS_LANG</programlisting>

        <para>

          These lines will change the Oracle date settings and will break
          OpenACS since OpenACS depends on the ANSI date format, YYYY-MM-DD
          dates.

        </para>
      </listitem>

      <listitem><para>

          Log out as oracle

        </para>
        
        <programlisting>
[oracle ~]$ exit</programlisting>
      </listitem>

      <listitem><para> 

          Log back in as <computeroutput>oracle</computeroutput> and double
          check that your environment variables are as intended. The
          <computeroutput>env</computeroutput> command lists all of the
          variables that are set in your environment, and
          <computeroutput>grep</computeroutput> shows you just the lines
          you want (those with ORA in it).

        </para>

        <programlisting>
[joeuser ~]$ su - oracle
[oracle ~]$ env | grep ORA</programlisting>

        <para>

          If it worked, you should see: 

        </para>

        <programlisting>
ORACLE_SID=ora8
ORACLE_BASE=/ora8/m01/app/oracle
ORACLE_TERM=vt100
ORACLE_HOME=/ora8/m01/app/oracle/product/8.1.7
ORA_NLS33=/ora8/m01/app/oracle/product/8.1.7/ocommon/nls/admin/data</programlisting>

        <para>

          If not, try adding the files to
          <computeroutput>~/.bashrc</computeroutput> instead of
          <computeroutput>.bash_profile</computeroutput>. Then logout and
          log back in again. Also, be certain you are doing
          <computeroutput>su - oracle</computeroutput> and not just
          <computeroutput>su oracle</computeroutput>. The
          <computeroutput>-</computeroutput> means that
          <computeroutput>.bashrc</computeroutput> and
          <computeroutput>.bash_profile</computeroutput> will be
          evaluated.

        </para>

        <para>

          Make sure that <computeroutput>/bin</computeroutput>,
          <computeroutput>/usr/bin</computeroutput>, and
          <computeroutput>/usr/local/bin</computeroutput> are in your path
          by typing:

        </para>

        <programlisting>
[oracle ~]$ echo $PATH
/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/home/oracle/bin:/ora8/m01/app/oracle/product/8.1.7/bin</programlisting>

        <para>

          If they are not, then add them to the
          <computeroutput>.bash_profile</computeroutput> by changing the
          PATH statement above to
          <computeroutput>PATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin</computeroutput>

        </para>
      </listitem>
    </itemizedlist>
  </sect2>

  <sect2 id="install-oracle-install">
    <title>Installing Oracle 8.1.7 Server</title>


    <itemizedlist>
      <listitem><para>
          Log in as <computeroutput>oracle</computeroutput> and
          start X if not already running. Start a new terminal:
        </para>

        <programlisting>
[joeuser ~]$ xhost +localhost
[joeuser ~]$ su - oracle
Password: **********
[oracle ~]$ export DISPLAY=localhost:0.0</programlisting>
      </listitem>

      <listitem><para>

          Find the <computeroutput>runInstaller</computeroutput> script

        </para>

        <itemizedlist>
          <listitem><para>

              If you are installing Oracle from a CD-ROM, it is located in
              the <computeroutput>install/linux</computeroutput> path from
              the cd-rom mount point

            </para>

            <programlisting>
[oracle ~]$ su - root
[root ~]# mount -t iso9660 /dev/cdrom /mnt/cdrom
[root ~]# exit
[oracle ~]$ cd /mnt/cdrom</programlisting>
          </listitem>

          <listitem><para>

              If you are installing from the tarball, the install script is
              located in the <computeroutput>Oracle8iR2</computeroutput>
              directory that was created when you expanded the archive.

            </para>

            <programlisting>
[oracle ~]$ cd /where/oracle/Disk1</programlisting>
          </listitem>
        </itemizedlist>

        <para>

          Check to make sure the file is there. 

        </para>

        <programlisting>
oracle:/where/oracle/Disk1$ ls
doc  index.htm  install  runInstaller  stage  starterdb</programlisting>

        <para>

          If you don&#39;t see
          <computeroutput>runInstaller</computeroutput>, you are in the
          wrong directory.

        </para>
      </listitem>

      <listitem><para>

          Run the installer

        </para>

        <programlisting>
oracle:/where/oracle/Disk1$ ./runInstaller</programlisting>

        <para>

          A window will open that welcomes you to the &#39;Oracle Universal
          Installer&#39; (OUI). Click on
          &quot;<computeroutput>Next</computeroutput>&quot;

        </para>

        <note>
          <para>
            Some people have had trouble with this step on RedHat 7.3 and 8.0. If
            so, try the following steps before calling
            <command>./runInstaller</command>:

          </para>
          <orderedlist>
            <listitem>
              <para>

                Execute the following command:
                <command>/usr/i386-glibc21-linux/bin/i386-glibc21-linux-env.sh</command>

              </para>
            </listitem>

            <listitem>
              <para>

                Type <command>export LD_ASSUME_KERNEL=2.2.5</command>

              </para>
            </listitem>
          </orderedlist>
        </note>
      </listitem>

      <listitem><para>

          The &quot;File Locations&quot; screen in the OUI: 

        </para>

        <itemizedlist>
          <listitem><para> 

              &quot;Source&quot; path should have been
              prefilled with &quot;(wherever you mounted the
              CDROM)<computeroutput>/stage/products.jar</computeroutput>&quot;

            </para></listitem>

          <listitem><para> 

              &quot;destination&quot; path says
              &quot;<computeroutput>/ora8/m01/app/oracle/product/8.1.7</computeroutput>&quot;

            </para>

            <para>

              If the destination is not correct it is because your
              environment variables are not set properly. Make sure you
              logged on as <computeroutput>oracle</computeroutput> using
              <computeroutput>su - oracle</computeroutput>. If so, edit the
              <computeroutput>~/.bash_profile</computeroutput> as you
              did in <xref linkend="install-oracle-preinstall"/>

            </para>
          </listitem>

          <listitem><para>

              Click &quot;Next&quot; (a pop up window will display Loading
              Product information).

            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>

          The &quot;Unix Group Name&quot; screen in the OUI:

        </para>

        <itemizedlist>
          <listitem><para> 

              The Unix Group name needs to be set to
              &#39;<computeroutput>oinstall</computeroutput>&#39; ( we made
              this Unix group earlier ).

            </para></listitem>

          <listitem><para>

              Click &quot;Next&quot;

            </para></listitem>

          <listitem>
	    <para>
              A popup window appears instantly, requesting you
              to run a script as root:
            </para>
          </listitem>
        <listitem>
          <itemizedlist>
            <listitem>
              <para>
                Debian users need to link
                <computeroutput>/bin/awk</computeroutput> to
                <computeroutput>/usr/bin/awk</computeroutput> before
                running the script below
              </para>
            <programlisting>
[joueser ~]$ su -
[root ~]# ln -s /usr/bin/awk /bin/awk</programlisting>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>
          Open a new terminal window, then type:
        </para>

        <programlisting>[joeuser ~]$ su -
[root ~]# cd /ora8/m01/app/oracle/product/8.1.7
[root ~]# ./orainstRoot.sh  
; You should see:
Creating Oracle Inventory pointer file (/etc/oraInst.loc)
Changing groupname of /ora8/m01/app/oracle/oraInventory to oinstall.
[root ~]# mkdir -p /usr/local/java
[root ~]# exit
[joeuser ~]$ exit</programlisting>

      </listitem>

      <listitem><para>
          Click &quot;Retry&quot;
        </para></listitem>
    </itemizedlist>
  </listitem>

    <listitem>
      <para>
        The &quot;Available Products&quot; screen in the OUI:
      </para>

      <itemizedlist>
        <listitem><para>
            Select &quot;Oracle 8i Enterprise Edition 8.1.7.1.0&quot;
        </para></listitem>

        <listitem><para>
            Click &quot;Next&quot;
          </para></listitem>

      </itemizedlist>
    </listitem>

    <listitem>
      <para>
        The &quot;Installation Types&quot; screen
      </para>

      <itemizedlist>
        <listitem>
          <para>
            Select the &quot;Custom&quot; installation type.
          </para>
        </listitem>

        <listitem><para>
            Click &quot;Next&quot;
          </para></listitem>
      </itemizedlist>
    </listitem>

    <listitem><para>
        The &quot;Available Product Components&quot; screen
      </para>

      <itemizedlist>
        <listitem><para>
            In addition to the defaults, make sure that &quot;Oracle SQLJ
            8.1.7.0,&quot; &quot;Oracle Protocol Support 8.1.7.0.0,&quot; and
            &quot;Linux Documentation 8.1.7.0.0&quot; are also checked.
          </para></listitem>

        <listitem><para>
            Click &quot;Next&quot;
          </para></listitem>

        <listitem><para>
            A progress bar will appear for about 1 minute.
          </para></listitem>
      </itemizedlist>
    </listitem>

    <listitem><para>
        The &quot;Component Locations&quot; screen in the OUI
      </para>

      <itemizedlist>
        <listitem><para> 
            Click on the &quot;Java Runtime Environment 1.1.8&quot; It
            should have the path
            &quot;<computeroutput>/ora8/m01/app/oracle/jre/1.1.8</computeroutput>&quot;
          </para></listitem>

        <listitem><para>
            Click &quot;Next&quot;
          </para></listitem>

        <listitem><para>
            A progress bar will appear for about 1 minute.
          </para></listitem>
      </itemizedlist>
    </listitem>

    <listitem><para>
        The &quot;Privileged Operation System Groups&quot; screen in the
        OUI
      </para>

      <itemizedlist>
        <listitem><para>
            Enter &quot;dba&quot; for &quot;Database Administrator
            (OSDBA) Group&quot;
          </para></listitem>

        <listitem><para>
            Enter &quot;dba&quot; for the &quot;Database Operator
            (OSOPER) Group&quot;
          </para></listitem>

          <listitem><para>
            Click &quot;Next&quot;
          </para></listitem>

        <listitem><para>
            A progress bar will appear for about 1 minute.
          </para></listitem>
      </itemizedlist>
    </listitem>

    <listitem><para>
        The &quot;Authentication Methods&quot; screen
      </para>
      <itemizedlist>
        <listitem><para>
            Click &quot;Next&quot;
          </para></listitem>
      </itemizedlist>
    </listitem>

    <listitem><para>

        The next screen is &quot;Choose JDK home directory&quot;

      </para>
      <itemizedlist>
        <listitem><para>

              Keep the default path: <computeroutput>/usr/local/java</computeroutput>

          </para></listitem>

        <listitem><para>

            Click &quot;Next&quot;

          </para></listitem>
      </itemizedlist>
    </listitem>
    
    <listitem><para>

        The &quot;Create a Database&quot; screen in the OUI
        
      </para>
      
      <itemizedlist>
        <listitem><para>

            Select &quot;No&quot; as we will do this later, after some
            important configuration changes.
            
          </para></listitem>
        
        <listitem><para>

            Click &quot;Next&quot;
            
          </para></listitem>
      </itemizedlist>
    </listitem>
    
    <listitem><para>

        The next screen is &quot;Oracle Product Support&quot;

      </para>
      
      <itemizedlist>
        <listitem><para>

            TCP should be checked with &quot;Status&quot; listed as
            Required

          </para></listitem>
        
        <listitem><para>

            Click &quot;Next&quot;

          </para></listitem>
      </itemizedlist>
    </listitem>
    
    <listitem><para>

        The &quot;Summary&quot; screen in the OUI

      </para>
      
      <itemizedlist>
        <listitem><para>

            Check the &quot;Space Requirements&quot; section to verify
            you have enough disk space for the install.

          </para></listitem>
          
          <listitem><para>
              Check that &quot;(144 products)&quot; is in the &quot;New
              Installations&quot; section title.
            </para></listitem>

          <listitem><para>
              Click &quot;Install&quot;
            </para></listitem>

          <listitem><para>
              A progress bar will appear for about 20 - 30 minutes. Now is a
              good time to take a break.
            </para></listitem>

          <listitem><para>
              A &quot;Setup Privileges&quot; window will popup towards the
              end of the installation asking you to run a script as
              <computeroutput>root</computeroutput>
            </para></listitem>

          <listitem><para> 
            Run the script. Switch to the oracle user first
            to set the environment appropriately and then do
            <command>su</command> to get root privileges, while keeping
            the oracle user's enviroment.
            </para>

            <programlisting>
[joeuser ~]$ su - oracle
Password: *********
[oracle ~]$ su
Password: *********
[root ~]# /ora8/m01/app/oracle/product/8.1.7/root.sh
; You should see the following.   

Creating Oracle Inventory pointer file (/etc/oraInst.loc)
Changing groupname of /ora8/m01/app/oracle/oraInventory to oinstall.
# /ora8/m01/app/oracle/product/8.1.7/root.sh
Running Oracle8 root.sh script...
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /ora8/m01/app/oracle/product/8.1.7
    ORACLE_SID=   ora8

Enter the full pathname of the local bin directory: [/usr/local/bin]: 

<computeroutput>Press ENTER here to accept default of /usr/local/bin</computeroutput>
      

Creating /etc/oratab file...
Entry will be added to the /etc/oratab file by
Database Configuration Assistants when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
IMPORTANT NOTE: Please delete any log and trace files previously
                created by the Oracle Enterprise Manager Intelligent
                Agent. These files may be found in the directories
                you use for storing other Net8 log and trace files.
                If such files exist, the OEM IA may not restart.</programlisting>
          </listitem>

          <listitem><para> 
              Do not follow the instructions on deleting trace
              and log files, it is not necessary.
            </para></listitem>
        </itemizedlist>

        <programlisting>
[root ~]# exit
[joeuser ~]$ exit</programlisting>
      </listitem>

      <listitem><para>
          Go back to the pop-up window and click &quot;OK&quot;
        </para></listitem>

      <listitem><para>
          The &quot;Configuration Tools&quot; screen in the OUI
        </para>

        <itemizedlist>
          <listitem><para>
              This window displays the config tools that will automatically
              be launched.
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;Welcome&quot; screen in the &quot;net 8 Configuration
          Assistant&quot;
        </para>

        <itemizedlist>
          <listitem><para>
              Make sure the &quot;Perform Typical installation&quot; is
              <emphasis role="strong">not</emphasis> selected.
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>

          <listitem><para> 
              The &quot;Directory Service Access&quot; screen in the
              &quot;Net 8 Configuration Assistant&quot;
            </para></listitem>

          <listitem><para>
              Select &quot;No&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;Listener Configuration, Listener Name&quot; screen in
          the &quot;Net 8 Configuration Assistant&quot;
        </para>

        <itemizedlist>
          <listitem><para>
              Accept the default listener name of &quot;LISTENER&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para> 
          The &quot;Listener Configuration, Select
          Protocols&quot; screen in the &quot;Net 8 Configuration
          Assistant&quot;
        </para>

        <itemizedlist>
          <listitem><para>
              The only choice in &quot;Select protocols:&quot; should be
              &quot;TCP/IP&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;Listener Configuration TCP/IP Protocol&quot; screen in
          the &quot;Net 8 Configuration Assistant&quot;
        </para>

        <itemizedlist>
          <listitem><para>
              Default Port should be 1521 and selected.
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para> 
          The &quot;Listener Configuration, More Listeners&quot; screen in
          the &quot;Net 8 Configuration Assistant&quot;
        </para>

        <itemizedlist>
          <listitem><para>
              Select &quot;No&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;Listener Configuration Done&quot; screen in the
          &quot;Net 8 Configuration Assistant&quot;
        </para>

        <itemizedlist>
          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para> 
          The &quot;Naming Methods Configuration&quot; screen
          in the &quot;Net 8 Configuration Assistant&quot;
        </para>

        <itemizedlist>
          <listitem><para>
              Select &quot;No&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;Done&quot; screen in the &quot;Net 8 Configuration
          Assistant&quot;
        </para>

        <itemizedlist>
          <listitem><para>
              Click &quot;Finish&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;End of Installation&quot; screen in the OUI
        </para>

        <itemizedlist>
          <listitem><para>
              Click &quot;Exit&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Yes&quot; on the confirmation pop up window.
            </para></listitem>

          <listitem><para>
              The Oracle Universal Installer window should have disappeared!
            </para></listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>

    <para>
      Congratulations, you have just installed Oracle 8.1.7 Server!
      However, you still need to create a database which can take about an
      hour of non-interactive time, so don&#39;t quit yet.
    </para>
  </sect2>

  <sect2 id="install-oracle-create">
    <title>Creating the First Database</title>
    
    <para>
      This step will take you through the steps of creating a customized
      database. Be warned that this process takes about an hour on a
      Pentium II with 128 MB of RAM.
    </para>

    <note>
      <para>RedHat 7.3 and 8.0 users: Before running <command>dbassist</command>, do the following.</para>
      <orderedlist>
        <listitem><para>
            Download the <ulink
            url="http://otn.oracle.com/software/products/oracle8i/htdocs/linuxsoft.html">glibc
            patch</ulink> from Oracle Technet into <computeroutput>/var/tmp</computeroutput>.
          </para></listitem>
        <listitem><para>
            cd $ORACLE_HOME
            </para></listitem>
        <listitem><para>
            tar xzf /var/tmp/glibc2.1.3-stubs.tgz
            </para></listitem>
        <listitem><para>
            ./setup_stubs
            </para></listitem>
      </orderedlist>
    </note>

    <itemizedlist>
      <listitem><para> 
          Make sure you are running X. Open up a terminal and
          <computeroutput>su</computeroutput> to oracle and then run the
          <computeroutput>dbassist</computeroutput> program.
        </para>

        <programlisting>
[joeuser ~]$ xhost +localhost
[joeuser ~]$ su - oracle
Password: *********
[oracle ~]$ export DISPLAY=localhost:0.0
[oracle ~]$ dbassist</programlisting>

      </listitem>

      <listitem><para>
          The &quot;Welcome&quot; screen in the Oracle Database
          Configuration Agent (ODCA)
        </para>

        <itemizedlist>
          <listitem><para>
              Select &quot;Create a database&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;Select database type&quot; screen in the ODCA 
        </para>

        <itemizedlist>
          <listitem><para>
              Select &quot;Custom&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;Primary Database Type&quot; window in ODCA 
        </para>

        <itemizedlist>
          <listitem><para>
              Select &quot;Multipurpose&quot;
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para>
          The &quot;concurrent users&quot; screen of the ODCA 
        </para>

        <itemizedlist>
          <listitem><para>
              Select &quot;60&quot; concurrent users. 
            </para></listitem>

          <listitem><para>
              Click &quot;Next&quot;
            </para></listitem>
        </itemizedlist>

      </listitem>

      <listitem><para>
          Select &quot;<computeroutput>Dedicated Server
            Mode</computeroutput>&quot;, click
          &quot;<computeroutput>Next</computeroutput>&quot;
        </para></listitem>

      <listitem><para>
          Accept all of the options, and click
          <computeroutput>Next</computeroutput> Oracle Visual
          Information Retrieval may be grayed out. If so, you can ignore
          it; just make sure that everything else is checked.
        </para></listitem>

      <listitem><para>
          For &quot;Global Database Name&quot;, enter
          &quot;<computeroutput>ora8</computeroutput>&quot;; for
          &quot;SID&quot;, also enter
          &quot;<computeroutput>ora8</computeroutput>&quot; (it should do
          this automatically).  Click <computeroutput>"Change
          Character Set</computeroutput> and select
          <computeroutput>UTF8</computeroutput>. Click
          &quot;<computeroutput>Next</computeroutput>&quot;.
        </para></listitem>

      <listitem><para>
          Accept the defaults for the next screen (control file
          location). Click
          &quot;<computeroutput>Next</computeroutput>&quot;
        </para></listitem>

      <listitem><para>
          Go to the &quot;temporary&quot; and
          &quot;rollback&quot; tabs, and change the Size
          (upper-right text box) to
          <computeroutput>150</computeroutput>MB. Click
          &quot;<computeroutput>Next</computeroutput>&quot;
        </para></listitem>

      <listitem><para>
          Increase the redo log sizes to
          <computeroutput>10000K</computeroutput> each. Click
          &quot;<computeroutput>Next</computeroutput>&quot;
        </para></listitem>

      <listitem><para>
          Use the default checkpoint interval &amp; timeout. Click
          &quot;<computeroutput>Next</computeroutput>&quot;
        </para></listitem>

      <listitem><para>        
          Increase &quot;<computeroutput>Processes</computeroutput>&quot;
          to <computeroutput>100</computeroutput>;
          &quot;<computeroutput>Block Size</computeroutput>&quot; to
          <computeroutput>4096</computeroutput> (better for small Linux
          boxes; use 8192 for a big Solaris machine).
        </para></listitem>

      <listitem><para>
          Accept the defaults for the Trace File Directory. Click
          &quot;<computeroutput>Next</computeroutput>&quot;
        </para></listitem>

      <listitem><para>
          Finally, select &quot;<computeroutput>Save information to a shell
            script</computeroutput>&quot; and click
          &quot;<computeroutput>Finish</computeroutput>&quot; (We&#39;re
          going to examine the contents of this file before creating our
          database.)
        </para></listitem>

      <listitem><para>
          Click the &quot;<computeroutput>Save</computeroutput>&quot;
          button. Oracle will automatically save it to the correct
          directory and with the correct file name. This will likely be
          <computeroutput>/ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib/sqlora8.sh</computeroutput>
        </para></listitem>

      <listitem><para> 
          It will alert you that the script has been saved
          successfully.
        </para></listitem>

      <listitem><para> 
          Now we need to customize the database configuration a bit. While
          still logged on as <computeroutput>oracle</computeroutput>, edit
          the database initialization script (run when the db loads). The
          scripts are kept in
          <computeroutput>$ORACLE_HOME/dbs</computeroutput> and the name of
          the script is usually
          <computeroutput>init</computeroutput><emphasis>SID</emphasis><computeroutput>.ora</computeroutput>
          where <emphasis>SID</emphasis> is the SID of your
          database. Assuming your
          <computeroutput>$ORACLE_HOME</computeroutput> matches our default
          of
          <computeroutput>/ora8/m01/app/oracle/product/8.1.7</computeroutput>,
          the following will open the file for editing.
        </para>

        <programlisting>
[oracle ~]$ emacs /ora8/m01/app/oracle/product/8.1.7/dbs/initora8.ora</programlisting>
      </listitem>

      <listitem><para>
          Add the following line to the end:
        </para>

        <programlisting>
nls_date_format = &quot;YYYY-MM-DD&quot;</programlisting>
      </listitem>

      <listitem><para>
          Now find the <computeroutput>open_cursors</computeroutput> line
          in the file. If you&#39;re using
          <computeroutput>emacs</computeroutput> scroll up to the top of
          the buffer and do <computeroutput>CTRL-S</computeroutput> and
          type <computeroutput>open_cursors</computeroutput> to find the
          line. The default is <computeroutput>100</computeroutput>. Change
          it to <computeroutput>500</computeroutput>.
        </para>

        <programlisting>
open_cursors = 500</programlisting>
      </listitem>

      <listitem><para>
          Save the file. In emacs, do <computeroutput>CTRL-X
            CTRL-S</computeroutput> to save followed by
          <computeroutput>CTRL-X CTRL-C</computeroutput> to exit or use
          the menu.
        </para></listitem>

      <listitem><para>
          At this point, you are ready to initiate database creation. We
          recommend shutting down X to free up some RAM unless you have 256
          MB of RAM or more.  You can do this quickly by doing a
          <computeroutput>CRTL-ALT-BACKSPACE</computeroutput>, but make
          sure you have saved any files you were editing. You should now be
          returned to a text shell prompt. If you get sent to a graphical
          login screen instead, switch to a virtual console by doing
          <computeroutput>CRTL-ALT-F1</computeroutput>. Then login as
          <computeroutput>oracle</computeroutput>.
        </para></listitem>

      <listitem><para>        
          Change to the directory where the database creation script is and
          run it:
        </para>

        <programlisting>
[oracle ~]$ cd /ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib
oracle:/ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib$ ./sqlora8.sh</programlisting>

        <para>
          In some instances, Oracle will save the file to
          <computeroutput>/ora8/m01/app/oracle/product/8.1.7/assistants/dbca</computeroutput>
          Try running the script there if your first attempt does not
          succeed.
        </para></listitem>

      <listitem><para>
          Your database will now be built. It will take &gt; 1 hour - no
          fooling.  You will see lots of errors scroll by (like:
          &quot;ORA-01432: public synonym to be dropped does not
          exist&quot;) Fear not, this is normal.
        </para>

        <para>
          Eventually, you&#39;ll be returned to your shell prompt. In the
          meantime, relax, you&#39;ve earned it.
        </para>
      </listitem>
    </itemizedlist>
  </sect2>

  <sect2 id="istall-oracle-test">
    <title>Acceptance Test</title>

    <para>
      For this step, open up a terminal and
      <computeroutput>su</computeroutput> to
      <computeroutput>oracle</computeroutput> as usual. You should be
      running X and Netscape (or other web browser) for this phase.
    </para>

    <itemizedlist>
      <listitem><para>
          You need to download the &quot;Oracle Acceptance Test&quot; file.
          It&#39;s available <ulink
          url="files/acceptance-sql.txt">here</ulink> and at <ulink
          url="http://philip.greenspun.com/wtr/oracle/acceptance-sql.txt">http://philip.greenspun.com/wtr/oracle/acceptance-sql.txt</ulink>.
          Save the file to <computeroutput>/var/tmp</computeroutput>
        </para></listitem>

      <listitem><para>
          In the oracle shell, copy the file.
        </para>

        <programlisting>
[oracle ~]$ cp /var/tmp/acceptance-sql.txt /var/tmp/acceptance.sql</programlisting>
      </listitem>

      <listitem><para>        
          Once you&#39;ve got the acceptance test file all set, stay in
          your term and type the following:
        </para>

        <programlisting>
[oracle ~]$ sqlplus system/manager</programlisting>

        <para>
          SQL*Plus should startup. If you get an <computeroutput>ORA-01034:
            Oracle not Available</computeroutput> error, it is because your
          Oracle instance is not running.  You can manually start it as
          the <computeroutput>oracle</computeroutput> user.</para>

        <programlisting>
[oracle ~]$ svrmgrl
SVRMGR&gt; connect internal
SVRMGR&gt; startup</programlisting>
      </listitem>

      <listitem><para>
          Now that you&#39;re into SQL*Plus, change the default passwords
          for system, sys, and ctxsys to &quot;alexisahunk&quot; (or to
          something you&#39;ll remember):
        </para>

        <programlisting>
SQL&gt; alter user system identified by alexisahunk;
SQL&gt; alter user sys identified by alexisahunk;
SQL&gt; alter user ctxsys identified by alexisahunk;</programlisting>
      </listitem>

      <listitem><para>
          Verify that your date settings are correct. 
        </para>

        <programlisting>
SQL&gt; select sysdate from dual;</programlisting>

        <para>
          If you don&#39;t see a date that fits the format
          <computeroutput>YYYY-MM-DD</computeroutput>, please read <xref
          linkend="install-oracle-troubleshooting"/>.
        </para></listitem>

      <listitem><para>
          At this point we are going to hammer your database with an
          intense acceptance test. This usually takes around 30 minutes.
        </para>

        <programlisting>
SQL&gt; @ /var/tmp/acceptance.sql

; A bunch of lines will scroll by.  You&#39;ll know if the test worked if
; you see this at the end:

SYSDATE
----------
2000-06-10

SQL&gt;</programlisting>

        <para>
          Many people encounter an error regarding <computeroutput>maximum
            key length</computeroutput>:
        </para>

        <programlisting>
ERROR at line 1:
ORA-01450: maximum key length (758) exceeded</programlisting>

        <para>
          This error occurs if your database block size is wrong and is
          usually suffered by people trying to load OpenACS into a
          pre-existing database.  Unfortunately, the only solution is to
          create a new database with a block size of at least
          <computeroutput>4096</computeroutput>. For instructions on how to
          do this, see <xref linkend="install-oracle-create"/> above. You
          can set the parameter using the
          <computeroutput>dbassist</computeroutput> program or by setting
          the <computeroutput>DB_BLOCK_SIZE</computeroutput> parameter in
          your database&#39;s creation script.
        </para>

        <para>
          If there were no errors, then consider yourself fortunate. Your
          Oracle installation is working.
        </para>
      </listitem>
    </itemizedlist>
  </sect2>

  <sect2 id="install-oracle-automating">
    <title>Automating Startup &amp; Shutdown</title>

    <para>
      You will want to automate the database startup and shutdown process.
      It&#39;s probably best to have Oracle spring to life when you boot up
      your machine.
    </para>

    <itemizedlist>
      <listitem><para> 
          Oracle includes a script called
          <computeroutput>dbstart</computeroutput> that can be used to
          automatically start the database. Unfortunately, the script
          shipped in the Linux distribution does not work out of the
          box. The fix is simple. Follow these directions to apply
          it. First, save <ulink url="files/dbstart.txt">dbstart</ulink> to
          <computeroutput>/var/tmp</computeroutput>. Then, as 
          <computeroutput>oracle</computeroutput>, do the following:
        </para>

        <programlisting>
[oracle ~]$ cp /var/tmp/dbstart.txt /ora8/m01/app/oracle/product/8.1.7/bin/dbstart 
[oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/dbstart</programlisting>
      </listitem>

      <listitem><para>

          While you&#39;re logged in as
          <computeroutput>oracle</computeroutput>, you should configure the
          <computeroutput>oratab</computeroutput> file to load your
          database at start.  Edit the file
          <computeroutput>/etc/oratab</computeroutput>: 
        </para>

        <itemizedlist>
          <listitem><para>You will see this line. </para>

            <programlisting>
ora8:/ora8/m01/app/oracle/product/8.1.7:N</programlisting>

            <para>
              By the way, if you changed the service name or have multiple
              databases, the format of this file is:
            </para>

            <para>
              <emphasis><computeroutput>service_name:$ORACLE_HOME:Y || N
                  (for autoload)</computeroutput></emphasis>
            </para>
          </listitem>

          <listitem><para>
              Change the last letter from &quot;N&quot; to
              &quot;Y&quot;. This tells Oracle that you want the database
              to start when the machine boots. It should look like this.
            </para>

            <programlisting>
ora8:/ora8/m01/app/oracle/product/8.1.7:Y</programlisting>

          </listitem>

          <listitem><para>
              Save the file &amp; quit the terminal.
            </para></listitem>
        </itemizedlist>
      </listitem>

      <listitem><para> 
          You need a script to automate startup and shutdown. Save <ulink
          url="files/oracle8i.txt">oracle8i.txt</ulink> in
          <computeroutput>/var/tmp</computeroutput>. Then login as
          <computeroutput>root</computeroutput> and install the
          script. (Debian users: substitute
          <computeroutput>/etc/init.d</computeroutput> for
          <computeroutput>/etc/rc.d/init.d</computeroutput> throughout 
          this section)
        </para>

        <programlisting>
[oracle ~]$ su -
[root ~]# cp /var/tmp/oracle8i.txt /etc/rc.d/init.d/oracle8i
[root ~]# chown root.root /etc/rc.d/init.d/oracle8i
[root ~]# chmod 755 /etc/rc.d/init.d/oracle8i</programlisting>
      </listitem>

      <listitem><para> 
          Test the script by typing the following commands and checking the
          output. (Debian Users: as root, do <computeroutput>mkdir
          /var/lock/subsys</computeroutput> first)
        </para>

<programlisting>
[root ~]# /etc/rc.d/init.d/oracle8i stop
Oracle 8i auto start/stop
Shutting Oracle8i:
Oracle Server Manager Release 3.1.7.0.0 - Production

Copyright (c) 1997, 1999, Oracle Corporation.  All
Rights Reserved.

Oracle8i Enterprise Edition Release 8.1.7.0.1 -
Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production

SVRMGR> Connected.
SVRMGR> Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR>
Server Manager complete.
Database &quot;ora8&quot; shut down.
      
[root ~]# /etc/rc.d/init.d/oracle8i start
Oracle 8i auto start/stop
Starting Oracle8i: 
SQL*Plus: Release 8.1.7.0.0 - Production on Wed Mar 6 17:56:02 2002

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

SQL&gt; Connected to an idle instance.
SQL&gt; ORACLE instance started.

Total System Global Area   84713632 bytes
Fixed Size                    73888 bytes
Variable Size              76079104 bytes
Database Buffers            8388608 bytes
Redo Buffers                 172032 bytes
Database mounted.
Database opened.
SQL> Disconnected

Database "ora8" warm started.

Database &quot;ora8&quot; warm started.</programlisting>
      </listitem>

      <listitem><para>        
          If it worked, then run these commands to make the startup and
          shutdown automatic. 
        </para>

        <itemizedlist>
          <listitem><para>Red Hat users:</para>
            <programlisting>
[root ~]# cd /etc/rc.d/init.d/                      
[root ~]# chkconfig --add oracle8i
[root ~]# chkconfig --list oracle8i
; You should see:
oracle8i        0:off   1:off   2:off   3:on    4:on    5:on    6:off</programlisting>
          </listitem>

          <listitem><para>Debian users:</para>
            <programlisting>
[root ~]# update-rc.d oracle8i defaults
 Adding system startup for /etc/init.d/oracle8i ...
   /etc/rc0.d/K20oracle8i -> ../init.d/oracle8i
   /etc/rc1.d/K20oracle8i -> ../init.d/oracle8i
   /etc/rc6.d/K20oracle8i -> ../init.d/oracle8i
   /etc/rc2.d/S20oracle8i -> ../init.d/oracle8i
   /etc/rc3.d/S20oracle8i -> ../init.d/oracle8i
   /etc/rc4.d/S20oracle8i -> ../init.d/oracle8i
   /etc/rc5.d/S20oracle8i -> ../init.d/oracle8i</programlisting>
            </listitem>

          <listitem><para>SuSE users:</para>
            <programlisting>
[root ~]# cd /etc/rc.d/init.d
root:/etc/rc.d/init.d# ln -s /etc/rc.d/init.d/oracle8i K20oracle8i
root:/etc/rc.d/init.d# ln -s /etc/rc.d/init.d/oracle8i S20oracle8i
root:/etc/rc.d/init.d# cp K20oracle8i rc0.d
root:/etc/rc.d/init.d# cp S20oracle8i rc0.d
root:/etc/rc.d/init.d# cp K20oracle8i rc1.d
root:/etc/rc.d/init.d# cp S20oracle8i rc1.d 
root:/etc/rc.d/init.d# cp K20oracle8i rc6.d
root:/etc/rc.d/init.d# cp S20oracle8i rc6.d
root:/etc/rc.d/init.d# cp K20oracle8i rc2.d
root:/etc/rc.d/init.d# cp S20oracle8i rc2.d
root:/etc/rc.d/init.d# cp K20oracle8i rc3.d
root:/etc/rc.d/init.d# cp S20oracle8i rc3.d 
root:/etc/rc.d/init.d# cp K20oracle8i rc4.d  
root:/etc/rc.d/init.d# cp S20oracle8i rc4.d  
root:/etc/rc.d/init.d# cp K20oracle8i rc5.d
root:/etc/rc.d/init.d# cp S20oracle8i rc5.d
root:/etc/rc.d/init.d# rm K20oracle8i
root:/etc/rc.d/init.d# rm S20oracle8i
root:/etc/rc.d/init.d# cd
[root ~]# SuSEconfig
Started the SuSE-Configuration Tool.
Running in full featured mode.
Reading /etc/rc.config and updating the system...
Executing /sbin/conf.d/SuSEconfig.gdm...   
Executing /sbin/conf.d/SuSEconfig.gnprint...
Executing /sbin/conf.d/SuSEconfig.groff...   
Executing /sbin/conf.d/SuSEconfig.java...    
Executing /sbin/conf.d/SuSEconfig.kdm...   
Executing /sbin/conf.d/SuSEconfig.pcmcia...
Executing /sbin/conf.d/SuSEconfig.perl...
Executing /sbin/conf.d/SuSEconfig.postfix...
Executing /sbin/conf.d/SuSEconfig.sendmail...
Executing /sbin/conf.d/SuSEconfig.susehilf...
Executing /sbin/conf.d/SuSEconfig.susehilf.add...
Executing /sbin/conf.d/SuSEconfig.susewm...
Executing /sbin/conf.d/SuSEconfig.tetex...
Executing /sbin/conf.d/SuSEconfig.ypclient...
Processing index files of all manpages...
Finished.</programlisting>
          </listitem>
        </itemizedlist>

      </listitem>

      <listitem><para>
          You also need some scripts to automate startup and shutdown of
          the Oracle8i listener. The listener is a name server that allows
          your Oracle programs to talk to local and remote databases using
          a standard naming convention. It is required for Intermedia Text
          and full site search.
        </para>

        <para>
          Download these three scripts into
          <computeroutput>/var/tmp</computeroutput>
        </para>

        <itemizedlist>
          <listitem><para>
              <ulink url="files/startlsnr.txt">startlsnr.txt</ulink>
            </para></listitem>

          <listitem><para>
              <ulink url="files/stoplsnr.txt">stoplsnr.txt</ulink>
            </para></listitem>

          <listitem><para>
              <ulink url="files/listener8i.txt">listener8i.txt</ulink>
            </para></listitem>
        </itemizedlist>

        <para>
          Now issue the following commands (still as
          <computeroutput>root</computeroutput>).
        </para>

        <programlisting>
[root ~]# su - oracle
[oracle ~]$ cp /var/tmp/startlsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
[oracle ~]$ cp /var/tmp/stoplsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr    
[oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
[oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr
[oracle ~]$ exit
[root ~]# cp /var/tmp/listener8i.txt /etc/rc.d/init.d/listener8i
[root ~]# cd /etc/rc.d/init.d
root:/etc/rc.d/init.d# chmod 755 listener8i</programlisting>

        <para>
          Test the listener automation by running the following commands
          and checking the output.
        </para>

        <programlisting>
root:/etc/rc.d/init.d# ./listener8i stop
Oracle 8i listener start/stop
Shutting down Listener for 8i: 
LSNRCTL for Linux: Version 8.1.7.0.0 - Production on 06-MAR-2002 18:28:49

(c) Copyright 1998, Oracle Corporation.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
The command completed successfully

    
root:/etc/rc.d/init.d# ./listener8i start
Oracle 8i listener start/stop
Starting the Listener for 8i: 
LSNRCTL for Linux: Version 8.1.7.0.0 - Production on 06-MAR-2002 18:28:52

(c) Copyright 1998, Oracle Corporation.  All rights reserved.

Starting /ora8/m01/app/oracle/product/8.1.7/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 8.1.7.0.0 - Production
System parameter file is /ora8/m01/app/oracle/product/8.1.7/network/admin/listener.ora
Log messages written to /ora8/m01/app/oracle/product/8.1.7/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 8.1.7.0.0 - Production
Start Date                06-MAR-2002 18:28:53
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /ora8/m01/app/oracle/product/8.1.7/network/admin/listener.ora
Listener Log File         /ora8/m01/app/oracle/product/8.1.7/network/log/listener.log
Services Summary...
  PLSExtProc        has 1 service handler(s)
  ora8      has 1 service handler(s)
The command completed successfully</programlisting>

        <para>
          This test will verify that the listener is operating
          normally. Login into the database using the listener naming
          convention.
        </para>

        <para>
          <computeroutput>sqlplus</computeroutput>
          <emphasis><computeroutput>username/password/@SID</computeroutput></emphasis>
        </para>

        <programlisting>
[root ~]# su - oracle
[oracle ~]$ sqlplus system/alexisahunk@ora8

SQL&gt; select sysdate from dual;

SYSDATE
----------
2002-02-22

SQL&gt; exit
[oracle ~]$ exit
[root ~]#</programlisting>

        <itemizedlist>
          <listitem><para>RedHat users:</para>
            <para>
              Now run <computeroutput>chkconfig</computeroutput> on the
              <computeroutput>listener8i</computeroutput> script.
            </para>
            <programlisting>
[root ~]# cd /etc/rc.d/init.d/
root:/etc/rc.d/init.d# chkconfig --add listener8i
root:/etc/rc.d/init.d# chkconfig --list listener8i
listener8i      0:off   1:off   2:off   3:on    4:on    5:on    6:off</programlisting>
          </listitem>

          <listitem><para>Debian users:</para>
            <para>
              Now run <computeroutput>update-rc.d</computeroutput> on the 
              <computeroutput>listener8i</computeroutput> script.
            </para>
            <programlisting>
[root ~]# update-rc.d listener8i defaults 21 19
 Adding system startup for /etc/init.d/listener8i ...
   /etc/rc0.d/K19listener8i -> ../init.d/listener8i
   /etc/rc1.d/K19listener8i -> ../init.d/listener8i
   /etc/rc6.d/K19listener8i -> ../init.d/listener8i
   /etc/rc2.d/S21listener8i -> ../init.d/listener8i
   /etc/rc3.d/S21listener8i -> ../init.d/listener8i
   /etc/rc4.d/S21listener8i -> ../init.d/listener8i
   /etc/rc5.d/S21listener8i -> ../init.d/listener8i</programlisting>
          </listitem>
        </itemizedlist>
      </listitem>
      
      <listitem><para>
          Test the automation
        </para>

        <para>
          As a final test, reboot your computer and make sure Oracle comes
          up. You can do this by typing
        </para>

        <programlisting>
[root ~]# /sbin/shutdown -r -t 0 now</programlisting>

        <para>
          Log back in and ensure that Oracle started automatically. 
        </para>

        <programlisting>
[joeuser ~]$ su - oracle
[oracle ~]$ sqlplus system/alexisahunk@ora8

SQL&gt; exit</programlisting>
      </listitem>
    </itemizedlist>

    <para>
      Congratulations, your installation of Oracle 8.1.7 is
      complete.
    </para>
  </sect2>

  <sect2 id="install-oracle-troubleshooting">
    <title>Troubleshooting Oracle Dates</title>

    <para>
      Oracle has an internal representation for storing the data based on
      the number of seconds elapsed since some date. However, for the
      purposes of inputing dates into Oracle and getting them back out,
      Oracle needs to be told to use a specific date format. By default, it
      uses an Oracle-specific format which isn&#39;t copacetic. You want
      Oracle to use the ANSI-compliant date format which is of form
      <computeroutput>&#39;YYYY-MM-DD&#39;</computeroutput>.
    </para>

    <para>
      To fix this, you should include the following line in
      <computeroutput>$ORACLE_HOME/dbs/init</computeroutput><emphasis>SID</emphasis><computeroutput>.ora</computeroutput>
      or for the default case,
      <computeroutput>$ORACLE_HOME/dbs/initora8.ora</computeroutput>
    </para>

    <programlisting>
nls_date_format = &quot;YYYY-MM-DD&quot;</programlisting>

    <para>
      You test whether this solved the problem by firing up
      <computeroutput>sqlplus</computeroutput> and typing: 
    </para>

    <programlisting>
SQL&gt; select sysdate from dual;</programlisting>

    <para>
      You should see back a date like
      <computeroutput>2000-06-02</computeroutput>. If some of the date is
      chopped off, i.e. like <computeroutput>2000-06-0</computeroutput>,
      everything is still fine. The problem here is that
      <computeroutput>sqlplus</computeroutput> is simply truncating the
      output. You can fix this by typing:
    </para>

    <programlisting>
SQL&gt; column sysdate format a15
SQL&gt; select sysdate from dual;</programlisting>

    <para>
      If the date does not conform to this format, double-check that you
      included the necessary line in the init scripts. If it still
      isn&#39;t working, make sure that you have restarted the database
      since adding the line:
    </para>

    <programlisting>
[joeuser ~]$ svrmgrl
SVRMGR> connect internal
Connected.
SVRMGR> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> startup
ORACLE instance started.</programlisting>

    <para>
      If you&#39;re sure that you have restarted the database since adding
      the line, check your initialization scripts. Make sure that the
      following line is not included:
    </para>

    <programlisting>
export nls_lang = american</programlisting>

    <para>
      Setting this environment variable will override the date
      setting. Either delete this line and login again or add the following
      entry to your login scripts <emphasis>after</emphasis> the
      <computeroutput>nls_lang</computeroutput> line:
    </para>

    <programlisting>
export nls_date_format = &#39;YYYY-MM-DD&#39;</programlisting>

    <para>
      Log back in again. If adding the
      <computeroutput>nls_date_format</computeroutput> line doesn&#39;t
      help, you can ask for advice in our <ulink
      url="http://www.openacs.org/forums/">OpenACS forums</ulink>.
    </para>
  </sect2>

  <sect2 id="install-oracle-procs">
    <title>Useful Procedures</title>

    <itemizedlist>
      <listitem><para>
          Dropping a tablespace
        </para>

        <itemizedlist>
          <listitem><para>
              Run sqlplus as the dba: 
            </para>

            <programlisting>
[oracle ~]$ sqlplus system/changeme</programlisting>
          </listitem>

          <listitem><para>            
              To drop a user and all of the tables and data owned by that
              user: 
            </para>

            <programlisting>
SQL&gt; drop user <emphasis>oracle_user_name</emphasis> cascade;</programlisting>
          </listitem>

          <listitem><para>
              To drop the tablespace: This will delete everything in the
              tablespace overriding any referential integrity
              constraints. Run this command only if you want to clean out
              your database entirely.
            </para>
            <programlisting>
SQL&gt; drop tablespace <emphasis>table_space_name</emphasis> including contents cascade constraints;</programlisting>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>

    <para>
      For more information on Oracle, please consult the <ulink
        url="http://oradoc.photo.net/">documentation</ulink>.
    </para>
  </sect2>

  <sect2 id="oracle-next-steps">
    <title>Oracle Next Steps</title>
    <para><xref linkend="install-oracle-monitoring"/></para>
  </sect2>
  <sect2 id="install-oracle-defaults">
    <title>Defaults</title>

    <para>We used the following defaults while installing Oracle.</para>

 
    <informaltable>
      <tgroup cols="3">
        <thead>
          <row>
            <entry>Variable</entry>
            <entry>Value</entry>
            <entry>Reason</entry>
          </row>
        </thead>

        <tbody>
          <row>
            <entry>ORACLE_HOME</entry>
            <entry>/ora8/m01/app/oracle/product/8.1.7</entry>
            <entry>This is the default Oracle installation directory.</entry>
          </row>
          
          <row>
            <entry>ORACLE_SERVICE</entry>
            <entry>ora8</entry>
            <entry>The service name is a domain-qualified identifier for
              your Oracle server.</entry>
          </row>
          
          <row>
            <entry>ORACLE_SID</entry>
            <entry>ora8</entry>
            <entry>This is an identifier for your Oracle server.</entry>
          </row>
          
          <row>
            <entry>ORACLE_OWNER</entry>
            <entry>oracle</entry>
            <entry>The user who owns all of the oracle files.</entry>
          </row>

          <row>
            <entry>ORACLE_GROUP</entry>
            <entry>dba</entry>
            <entry>The special oracle group. Users in the dba group are
              authorized to do a <computeroutput>connect
              internal</computeroutput> within
              <computeroutput>svrmgrl</computeroutput> to gain full system
              access to the Oracle system.</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>

    <para><phrase role="cvstag">($Id: oracle.xml,v 1.21 2006/07/17 05:38:37 torbenb Exp $)</phrase></para>
  </sect2>


</sect1>
