Index: openacs-4/packages/acs-core-docs/www/oracle.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/oracle.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-core-docs/www/oracle.html 17 Oct 2001 20:39:25 -0000 1.2 +++ openacs-4/packages/acs-core-docs/www/oracle.html 2 Feb 2002 03:47:32 -0000 1.3 @@ -1,345 +1,623 @@ - -5. Installing Oracle 8.1.6

Home : Documentation : Part II. For ACS Admins : 2. Installing on Unix/Linux : 5. Installing Oracle 8.1.6 

5. Installing Oracle 8.1.6

Table of Contents

5.1. Acquire Oracle 8.1.6 Enterprise Edition
5.2. Things to Keep in Mind
5.3. Pre-Installation Tasks
5.4. Installing Oracle 8.1.6 Server
5.5. Creating the First Database
5.6. Acceptance Test
5.7. Automating Startup & Shutdown
5.8. Troubleshooting Oracle Dates
5.9. Useful Procedures
5.10. Defaults

NOTE: -This document was written based on Oracle, version 8.1.6. -However, the same approach should lead to a successful installation of -Oracle 8.1.7. If you encounter any incompatibilities, please -let us know

5.1. Acquire Oracle 8.1.6 Enterprise Edition

You can obtain the software through a variety of methods:

  1. Order a CD from the Oracle Store. -There is a link under the heading Buying Tips that says "Learn -how to trial Oracle software." Click this for instructions on how to -make your order. The cost is currently $39.95 with delivery estimated between -3-4 business days. - - -

  2. Request a free demonstration CD. At the -Oracle Downloads page, click on the appropriate version of Oracle 8.1.6 -Release 2 for your OS. You should see a "Try Online" link. After -filling out some information forms, you should be able to order a version of -the CD. This takes about 2-3 weeks for delivery. - - -

  3. You can download Oracle from the Technet ftp site. The Linux version is -at ftp://ftp.oracle.com/pub/www/otn/linux/oracle8i/oracle8161_tar.gz

    Note that the Oracle tarball that you will download is huge (> -250MB).

    • Oracle 8.1.6 now comes with a Java RunTime Environment built-in to the -distribution, so you no longer have to download and install it separately. - - -

    • After the download is complete, untar the file to a convenient location. -To do this, you will need to login and cd to the directory where the archive -is.

      +
      +
      +
      +
      +Install Oracle 8.1.7
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +

      +Install Oracle 8.1.7

      +

      Skip this page if you're not interested in Oracle

      +

      +NOTE: This document + was originally written based on Oracle, version 8.1.6. However, the + same approach should lead to a successful installation of Oracle + 8.1.7. If you encounter any incompatibilities, please let us know +

      +

      +NOTE: We've not yet tested + OpenACS 4 under Oracle 9i

      +

      +NOTE: 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 document. +

      +
      +

      +Acquire Oracle 8.1.7 Enterprise Edition

      +

      + You can obtain the software through a variety of methods (You'll need + to become a member of technet.oracle.com, which is + free): +

      +
        +
      1. + Order a CD from the Oracle + Store. The cost is currently $39.95 for a 30-day + evaluation copy with delivery estimated between 3-4 business + days. +

      2. +
      3. +

        + Download the software from the + Oracle Downloads page. +

        +
          +
        • + Oracle 8.1.7 now comes with a Java RunTime + Environment built-in to the distribution, so you no longer + have to download and install it separately. +

        • +
        • +

          + After the download is complete, untar the file + to a convenient location. To do this, you will need to login + and cd to the directory where the archive is. +

          +
           $ cd /directory/where/oracle/is
          -$ tar -xzvf oracle8161_tar.gz
          -       
          -

5.2. Things to Keep in Mind

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 Section 5.10..

5.3. Pre-Installation Tasks

Though Oracle 8.1.6 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 root user. We recommend -entering the X window system as a user other than root and -then doing a su -. This command gives you full root access.

  • Login in as a non-root user +$ tar -xvf oracle81701.tar +

  • +
+ +
  • + It used to be possible to get a free CD by mail, but + I can no longer find the link for that option. +

  • +
    +
    +
    +

    +Things to Keep in Mind

    +

    + 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 the section called “Defaults”. +

    +
    +
    +

    +Pre-Installation Tasks

    +

    + 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 + root user. We recommend entering the + X window system as a normal user and then doing a su + -. This command gives you full root access. +

    +

    5.4. Installing Oracle 8.1.6 Server

    Congratulations, you have just installed Oracle 8.1.6 Server! However, you -still need to create a database which can take about an hour of -non-interactive time, so don't quit yet.

    5.5. Creating the First Database

    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.

    5.6. Acceptance Test

    For this step, open up a terminal and su to oracle as usual. You should be -running X and Netscape for this phase.

    5.7. Automating Startup & Shutdown

    You will want to automate the database startup and shutdown process. -It's probably best to have Oracle spring to life when you boot up your -machine.

    +
    +

    +Automating Startup & Shutdown

    +

    + You will want to automate the database startup and shutdown process. + It's probably best to have Oracle spring to life when you boot up + your machine. +

    +
      +
    • +

      + Oracle includes a script called + dbstart 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 dbstart to + /tmp. Then, as + oracle, do the following: +

      +
      +oracle:~$ cp /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
      +
    • +
    • +

      - -

  • You need a script to automate startup and shutdown. Save oracle8i.txt in /tmp. Then login as -root and install the script.

    - 
    -$ su -
    -# cp /tmp/oracle8i.txt /etc/rc.d/init.d/oracle8i
    -# chown root.root /etc/rc.d/init.d/oracle8i
    -# chmod 700 /etc/rc.d/init.d/oracle8i      
    - 
    -
  • Test the script by typing the following commands and checking the output.

    -# /etc/rc.d/init.d/oracle8i stop
    +		  While you're logged in as
    +		  oracle, you should configure the
    +		  oratab file to load your
    +		  database at start.  Edit the file
    +		  /etc/oratab: 
    +		

    +
      +
    • +

      You will see this line.

      +
      +ora8:/ora8/m01/app/oracle/product/8.1.7:N
      +

      + By the way, if you changed the service name or have multiple + databases, the format of this file is: +

      +

      + service_name:$ORACLE_HOME:Y || N + (for autoload) +

      +
    • +
    • +

      + Change the last letter from "N" to + "Y". This tells Oracle that you want the database + to start when the machine boots. It should look like this. +

      +
      +ora8:/ora8/m01/app/oracle/product/8.1.7:Y
      +
    • +
    • + Save the file & quit the terminal. +

    • +
    + +
  • +

    + You need a script to automate startup and shutdown. Save oracle8i.txt in + /tmp. Then login as + root and install the + script. (Debian users: substitute + /etc/init.d for + /etc/rc.d/init.d throughout + this section) +

    +
    +oracle:~$ su -
    +root:~# cp /tmp/oracle8i.txt /etc/rc.d/init.d/oracle8i
    +root:~# chown root.root /etc/rc.d/init.d/oracle8i
    +root:~# chmod 700 /etc/rc.d/init.d/oracle8i
    +
  • +
  • +

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

    +
    +root:~# /etc/rc.d/init.d/oracle8i stop
     Oracle 8i auto start/stop
     Shutting Oracle8i:
     Oracle Server Manager Release 3.1.6.0.0 - Production
    @@ -713,9 +1222,9 @@
     ORACLE instance shut down.
     SVRMGR> 
     Server Manager complete.
    -Database "ora8" shut down.
    +Database "ora8" shut down.
           
    -# /etc/rc.d/init.d/oracle8i start
    +root:~# /etc/rc.d/init.d/oracle8i start
     Oracle 8i auto start/stop
     Starting Oracle8i: 
     SQL*Plus: Release 8.1.6.0.0 - Production on Sat Jun 10 17:56:02 2000
    @@ -734,34 +1243,81 @@
     Database opened.
     SQL> Disconnected
     
    -Database "ora8" warm started.
    - 
    -
  • If it worked, then run these commands to make the startup and shutdown -automatic.

    -# cd /etc/rc.d/init.d/                      
    -# chkconfig --add oracle8i
    -# chkconfig --list oracle8i
    +Database "ora8" warm started.
    + +
  • +

    + If it worked, then run these commands to make the startup and + shutdown automatic. +

    +
      +
    • +

      Red Hat users:

      +
      +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
      - 
      -
  • 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.

    Download these three scripts into /tmp

    Now issue the following commands (still as root).

    -# su - oracle
    -# cp /tmp/startlsnr.txt /ora8/m01/app/oracle/product/8.1.6/bin/startlsnr
    -$ cp /tmp/stoplsnr.txt /ora8/m01/app/oracle/product/8.1.6/bin/stoplsnr    
    -$ chmod 700 /ora8/m01/app/oracle/product/8.1.6/bin/startlsnr
    -$ chmod 700 /ora8/m01/app/oracle/product/8.1.6/bin/stoplsnr
    -$ exit
    -; You should now be back as root.
    -# cp /tmp/listener8i.txt /etc/rc.d/init.d/listener8i
    -# cd /etc/rc.d/init.d
    -# chmod 700 listener8i
    -  
    -

    Test the listener automation by running the following commands and -checking the output.

    -# ./listener8i stop
    +oracle8i        0:off   1:off   2:off   3:on    4:on    5:on    6:off
    + +
  • +

    Debian users:

    +
    +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
    +
  • + + +
  • +

    + 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. +

    +

    + Download these three scripts into + /tmp +

    + +

    + Now issue the following commands (still as + root). +

    +
    +root:~# su - oracle
    +oracle:~$ cp /tmp/startlsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
    +oracle:~$ cp /tmp/stoplsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr    
    +oracle:~$ chmod 700 /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
    +oracle:~$ chmod 700 /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr
    +oracle:~$ exit
    +root:~# cp /tmp/listener8i.txt /etc/rc.d/init.d/listener8i
    +root:~# cd /etc/rc.d/init.d
    +root:/etc/rc.d/init.d# chmod 700 listener8i
    +

    + Test the listener automation by running the following commands + and checking the output. +

    +
    +root:/etc/rc.d/init.d# ./listener8i stop
     Oracle 8i listener start/stop
     Shutting down Listener for 8i: 
     LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 10-JUN-2000 18:28:49
    @@ -779,11 +1335,11 @@
     
     (c) Copyright 1998, 1999, Oracle Corporation.  All rights reserved.
     
    -Starting /ora8/m01/app/oracle/product/8.1.6/bin/tnslsnr: please wait...
    +Starting /ora8/m01/app/oracle/product/8.1.7/bin/tnslsnr: please wait...
     
     TNSLSNR for Linux: Version 8.1.6.0.0 - Production
    -System parameter file is /ora8/m01/app/oracle/product/8.1.6/network/admin/listener.ora
    -Log messages written to /ora8/m01/app/oracle/product/8.1.6/network/log/listener.log
    +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)))
     
    @@ -797,17 +1353,24 @@
     Trace Level               off
     Security                  OFF
     SNMP                      OFF
    -Listener Parameter File   /ora8/m01/app/oracle/product/8.1.6/network/admin/listener.ora
    -Listener Log File         /ora8/m01/app/oracle/product/8.1.6/network/log/listener.log
    +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
    -   
    -
  • This test will verify that the listener is operating normally. Login into -the database using the listener naming convention.

    sqlplus username/password/@SID

    -# su - oracle
    -$ sqlplus system/alexisahunk@ora8
    +The command completed successfully
    +

    + This test will verify that the listener is operating + normally. Login into the database using the listener naming + convention. +

    +

    + sqlplus + username/password/@SID +

    +
    +root:~# su - oracle
    +oracle:~$ sqlplus system/alexisahunk@ora8
     
     SQL> select sysdate from dual;
     
    @@ -816,71 +1379,243 @@
     2000-06-10
     
     SQL> exit
    -$ exit
    -#
    -   
    -

    Now run chkconfig on the listener8i script.

    -# cd /etc/rc.d/init.d/
    -# chkconfig --add listener8i
    -# chkconfig --list listener8i
    -listener8i      0:off   1:off   2:off   3:on    4:on    5:on    6:off
    -   
    -
  • Test the automation

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

    -# /sbin/shutdown -r -t 0 now
    -   
    -

    -Log back in and ensure that Oracle started automatically. -

    -$ su - oracle
    -$ sqlplus system/alexisahunk@ora8
    +oracle:~$ exit
    +root:~#
    +
      +
    • +

      RedHat users:

      +

      + Now run chkconfig on the + listener8i script. +

      +
      +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
      +
    • +
    • +

      Debian users:

      +

      + Now run update-rc.d on the + listener8i script. +

      +
      +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
      +
    • +
    + +
  • +

    + Test the automation +

    +

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

    +
    +root:~# /sbin/shutdown -r -t 0 now
    +

    + Log back in and ensure that Oracle started automatically. +

    +
    +joeuser:~$ su - oracle
    +oracle:~$ sqlplus system/alexisahunk@ora8
     
    -SQL> exit
    -  
    -
  • Congratulations, your installation of Oracle 8.1.6 is complete.

    5.8. Troubleshooting Oracle Dates

    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't copacetic. You want Oracle to use the ANSI-compliant date -format which is of form 'YYYY-MM-DD'.

    To fix this, you should include the following line in -$ORACLE_HOME/dbs/initSID.ora or for -the default case, -$ORACLE_HOME/dbs/initora8.ora

    -nls_date_format = "YYYY-MM-DD"
    -

    -You test whether this solved the problem by firing up -sqlplus and typing: -

    -SQL> select sysdate from dual;
    -

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

    +SQL> exit
    + + +

    + Congratulations, your installation of Oracle 8.1.7 is + complete. +

    + +
    +

    +Troubleshooting Oracle Dates

    +

    + 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't copacetic. You want + Oracle to use the ANSI-compliant date format which is of form + 'YYYY-MM-DD'. +

    +

    + To fix this, you should include the following line in + $ORACLE_HOME/dbs/initSID.ora + or for the default case, + $ORACLE_HOME/dbs/initora8.ora +

    +
    +nls_date_format = "YYYY-MM-DD"
    +

    + You test whether this solved the problem by firing up + sqlplus and typing: +

    +
    +SQL> select sysdate from dual;
    +

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

    +
     SQL> column sysdate format a15
    -SQL> select sysdate from dual;
    -

    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't -working, make sure that you have restarted the database since adding the line -if you didn't do it prior to database creation.

    If you'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:

    -export nls_lang = american
    -

    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 after the nls_lang line:

    -export nls_date_format = 'YYYY-MM-DD'
    -

    Log back in again. If adding the nls_date_format line -doesn't help, you can ask for advice in our -web/db forum.

    5.9. Useful Procedures

    For more information on Oracle, please consult the documentation.

    5.10. Defaults

    We used the following defaults while installing Oracle.

    VariableValueReason
    ORACLE_HOME/ora8/m01/app/oracle/product/8.1.6This is the default Oracle installation directory.
    ORACLE_SERVICEora8The service name is a domain-qualified identifier for your Oracle -server.
    ORACLE_SIDora8This is an identifier for your Oracle server.
    ORACLE_OWNERoracleThe user who owns all of the oracle files.
    ORACLE_GROUPdbaThe special oracle group. Users in the dba group are authorized to do a -connect internal within svrmgrl to gain full system -access to the Oracle system.

    ($Id$)

    +SQL> select sysdate from dual; +

    + 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't working, make sure that you have restarted the database + since adding the line if you didn't do it prior to database + creation. +

    +

    + If you'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: +

    +
    +export nls_lang = american
    +

    + 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 after the + nls_lang line: +

    +
    +export nls_date_format = 'YYYY-MM-DD'
    +

    + Log back in again. If adding the + nls_date_format line doesn't + help, you can ask for advice in our OpenACS forum. +

    + +
    +

    +Useful Procedures

    +
    +

    + For more information on Oracle, please consult the documentation. +

    +
    +
    +

    +Defaults

    +

    We used the following defaults while installing Oracle.

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    VariableValueReason
    ORACLE_HOME/ora8/m01/app/oracle/product/8.1.7This is the default Oracle installation directory.
    ORACLE_SERVICEora8The service name is a domain-qualified identifier for + your Oracle server.
    ORACLE_SIDora8This is an identifier for your Oracle server.
    ORACLE_OWNERoracleThe user who owns all of the oracle files.
    ORACLE_GROUPdbaThe special oracle group. Users in the dba group are + authorized to do a connect + internal within + svrmgrl to gain full system + access to the Oracle system.
    +
    +

    ($Id$)

    + + + +