Oracle 9i (9.0.1) on RedHat 7.3

From Oracle FAQ
Jump to: navigation, search

This document provides quick installation guide for Oracle 9i release 1 (9.0.1) database on RedHat linux 7.3.

Please note that oracle 9i release 1 is not certified to run on RedHat 7.3, so you should not use this combination on a production server. You can examine Oracle certification matrix at Metalink.

Things you need before you start[edit]

Download the Blackdown Linux port of Sun's Java Development Kit available at www.blackdown.org

Unpacking downloaded installation files[edit]

If you downloaded database installation files from Oracle site (Linux9i_Disk1.cpio.gz, Linux9i_Disk2.cpio.gz and Linux9i_Disk3.cpio.gz) gunzip them somewhere and you'll get three .cpio files.

Now unpack cpio archives:

# cpio -idmv < Linux9i_Disk1.cpio
# cpio -idmv < Linux9i_Disk2.cpio
# cpio -idmv < Linux9i_Disk3.cpio

Now you should have three directories (Disk1, Disk2 and Disk3) containing installation files.

Installation procedure[edit]

Install Java development kit, either JDK-1.1.8_v3 or JDK-1.3.1 I used JDK-1.3.1. According to jdk documentation, install jdk under /usr/local:

# tar -xvjf your_JDK_version -C /usr/local/

(replace your_JDK_version with filename of your downloaded JDK, e.g. j2sdk-1.3.1-FCS-linux-i386.tar.bz2)

Create user oracle and dependent groups:

# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba oracle
# passwd oracle

Create user that apache with primary group oinstall:

# groupadd apache
# useradd -g oinstall -G apache  apache
# passwd apache

Create directories in which oracle software will be installed. Oracle recommends OFA - Optimal Flexible Architecture (see oracle installation guide), but in this example everything will be installed under /home/oracle:

# mkdir /home/oracle/product
# mkdir /home/oracle/product/9.0.1
# chown -R oracle.oinstall /home/oracle/*
# mkdir /var/opt/oracle
# chown oracle.dba /var/opt/oracle

Now login as user oracle and put the following lines at the end of your .bashrc:

#oracle 9i
export ORACLE_HOME=/home/oracle/product/9.0.1
export ORACLE_BASE=/home/oracle
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export ORACLE_TERM=xterm
export PATH=$PATH:$ORACLE_HOME/bin:/usr/local/java/bin
export TNS_ADMIN=$ORACLE_HOME/config

# change this NLS settings to suit your taste
# or don't put anything and fall back to
# american NLS settings
export NLS_LANG='croatian_croatia.ee8iso8859p2'
export NLS_SORT=xcroatian

if [ -z $LD_LIBRARY_PATH ]
then
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
else
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
fi
if [ -z $CLASSPATH ]
then
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
   CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
   export CLASSPATH
else
   CLASSPATH=$CLASSPATH:$ORACLE_HOME/JRE:$ORACLE_HOME/jlib
    CLASSPATH=$CLASSPATH:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
   export CLASSPATH
fi

Since I am from Croatia, I use Croatian national language support (NLS_LANG, NLS_DATE_LANGUAGE, NLS_SORT and NLS_DATE_FORMAT). You should set these variables to suit your needs. Note that all other variables defined here are mandatory.

Listing of valid Oracle NLS Data parameters including supported languages, territories and storage character sets can be found here. Now .bashrc should be executed in order to initialize these variables:

$ source /home/.bashrc

or just log off and than back on as user oracle.

If you use some shell other than bash (tcsh, sh, ...) these variables should be set according to syntax of your shell and put in script that automatically executes at user login.

Oracle installer MUST be run from Xwindows by user oracle. Start Xwindows and from terminal window and start the installer:

$ /wherever/you/unpacked/it/Disk1/runInstaller

or (if you have the CD set):

$ /mnt/cdrom/runInstaller

If you install oracle from CD, you should not change directory to CD-ROM and run installer from there because later on you will not be able to unmount the first CD.

The genclntsh issue[edit]

In order to properly relink the oracle software you should edit the $ORACLE_HOME/bin/genclntsh script before the relink process starts. After the files start installing, open $ORACLE_HOME/bin/genclntsh file with your favorite editor (Don't worry, you'll have plenty of time before relink starts :), find the line containing

LD_SELF_CONTAINED="-z defs"

(line 147) and change it to

LD_SELF_CONTAINED=""

Now all of the oracle software should relink properly.

Starting the database for the first time[edit]

Starting the database[edit]

In .bashrc (if you use bash shell) for user oracle add variable ORACLE_SID=your_database_instance. Default value for instance is ORCL, so your line would look like this:

export ORACLE_SID=ORCL

Now we should set this variable for current session:

$ export ORACLE_SID=ORCL

alternatively, you can log off and than back on.

Now open /etc/oratab with your favorite editor, and make sure that it contains the following line:

orcl:/home/oracle/product/9.0.1:Y

(you should replace 'orcl' with the name of your instance)

Let's actually start the database now:

$ dbstart

Or you can do it the other way:

[ora9@marvin ora9]$ sqlplus /nolog

SQL*Plus: Release 9.0.1.0.0 - Production on Čet Srp 4 00:28:08 2002

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

SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area  286025124 bytes
Fixed Size                   279972 bytes
Variable Size             218103808 bytes
Database Buffers           67108864 bytes
Redo Buffers                 532480 bytes
Database mounted.
Database opened.
SQL> select count (1) from tab;

  COUNT(1)
----------
      2172

SQL> select * from scott.dept;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.0.1.0.0 - Production
With the Partitioning option
JServer Release 9.0.1.0.0 - Production
[ora9@marvin ora9]$

Shutting down the database[edit]

To shut down the database use:

$ dbshut

or through the SQL*PLUS:

[ora9@marvin ora9]$ sqlplus /nolog

SQL*Plus: Release 9.0.1.0.0 - Production on Čet Srp 4 00:35:13 2002

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

SQL> connect / as sysdba
Connected.
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.0.1.0.0 - Production
With the Partitioning option
JServer Release 9.0.1.0.0 - Production
[ora9@marvin ora9]$

Notes on memory usage:[edit]

I have 256M RAM, and 450M swap partition. First time I tried installing 9i I ran completely out of memory, so I had to add more swap space on the run. Here's a little tip how to do it:

First, make a file that will act as additional swap space, let's say 500 Megs:

# dd if=/dev/zero of=tempswap bs=1M count=500

Now we should change the file permissions:

# chmod 600 tempswap

Finally we format the "partition" as swap and add it to swap space:

# mke2fs tempswap
# mkswap tempswap
# swapon tempswap

Republished with permission from Denis Klaric. Original URL: http://staff.in2.hr/denis/oracle/901install_rh73_en.html