Installing Oracle8i (8.1.6) on Red Hat

(This document is a blatent rip-off of a more comprehensive version, by Jesus M. Salvo Jr, with bits of ArsDigita's notes)

1. Preparing to Install

1.1 Setup Linux groups and accounts

# groupadd dba
# useradd -g dba -m oracle
Now change the oracle account password

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

1.2 Setup environment variables

As oracle, add the following lines to /home/oracle/.bash_profile

export ORACLE_BASE=/apps/oracle
export ORACLE_HOME=$ORACLE_BASE/product/8.1.6
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_SID=ora816
export ORACLE_TERM=vt100
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

umask 022

Note: You should already have a export statement for PATH. Mine reads export USERNAME BASH_ENV PATH. Make sure this line comes after the lines you added, and that your lines come after the original PATH= line.

1.3 Setup Symbolic Links for Database Files

If you're installing on a machine with small disks that are likely to be upgraded, you can a symbolic link to access the database directory which will facilitate easy hardware changes or addition of new drives. For example:

As root, create the actual directory where the database will be stored:

# mkdir -p /data/oradata/MyDatabase
# chown -R oracle:dba /data
# chmod -R 770 /data
Now create the directory where Oracle "thinks" the database is:
# mkdir /MyDatabase
# chown oracle:dba /MyDatabase
# chmod 770 /MyDatabase
# ln -s /data/oradata/MyDatabase /MyDatabase/oradata
Now you have a symbolic link, /MyDatabase/oradata which you will use to write to the database. If you need to change the location of the database later, you may copy the files to the new location, and change the symbolic link to point to the new location.

2. Installation

Login as oracle, mount the CD and start X Window:

mount /dev/cdrom
startx
Either double click on the runInstaller icon in your file manager (in /mnt/cdrom) or in a terminal in X Window, type /mnt/cdrom/runInstaller. The following headings correspond to the page headings in the Oracle Universal Installer.

Welcome

Click Next

File Locations

The source will default to /stage/products.jar on the CD, which is fine.
The destination will be $ORACLE_HOME. If it's not, you did something wrong earlier.
Click Next

Inventory Location (First Time Install Only)

Default base directory will be /apps/oracle/oraInventory.
Click OK

Unix Group Name (First Time Install Only)

Type dba

Click Next

Pop-up Window (First Time Install Only)

Open a terminal in another window and run the script as root:
$ su
# /apps/oracle/product/8.1.6/orainstRoot.sh
Return to the pop-up window and click Retry.

Available Products

Select Oracle8i 8.1.6.1.0 Click Next

Installation Types

Select Custom
Click Next

Available Product Components

Select any additional components if you want them. Make sure you tick Oracle SQLJ 8.1.6.0.
Click Next

Component Locations

No need to select alternate locations. My Total Required Disk Space was 483Mb
Click Next

Privileged Operation System Groups

The two groups should be dba. If not, you did something wrong earlier.
Click Next

Create Database

Select No.
Click Next

Summary

Click Install. Note the location of the log files shown below the progress bar (/apps/oracle/oraInventory/logs/installActions.log for me).

My machine takes 10m 06s from clicking Install to displaying the next dialogue.
When it's finished copying and linking, you'll get a "Setup Privileges" dialogue box. In a terminal, as oracle, type:
 cd $ORACLE_HOME
 su
 ./root.sh
The script asks for the pathname of the local bin directory. You can accept the default of /usr/bin by just pressing [ENTER].

Click OK back in the dialogue box.

Configuration Tools

This will launch the Net 8 Configuration Assistant. The following headings refer to the title bar in this window until stated otherwise.

Net8 Configuration Assistant: Welcome

Click Next

Net8 Configuration Assistant: Directory Service Access

Select the No option.
Click Next

Net8 Configuration Assistant: Listener Configuration, Listener Name

Leave the default name of "Listener".
Click Next

Net8 Configuration Assistant: Listener Configuration, Select Protocols

TCP/IP should be in "Selected Protocols".
Click Next

Net8 Configuration Assistant: Listener Configuration, TCP/IP Protocol

Use the standard port number of 1521.
Click Next

Net8 Configuration Assistant: Listener Configuration, More Listeners?

Leave "No" selected.
Click Next

Net8 Configuration Assistant: Listener Configuration Done

Click Next

Net8 Configuration Assistant: Naming Methods Configuration

Leave "No" selected.
Click Next

Net8 Configuration Assistant: Done

Click Finish

The Net8 Configuration Assistant will close, and you'll be back to the Oracle Universal Installer.

End of Installation

Click Exit
Click Yes

3. Database Creation

Still in X Window, either double click on the dbassist icon in your file manager in /apps/oracle/product/8.1.6/bin) or in a terminal type $ORACLE_HOME/bin/dbassist.

Select Create a database
Click Next

Select Custom
Click Next

Select Multipurpose
Click Next

If you're just playing, leave concurrently connected users at 15. Otherwise 60 is the value suggested by ArsDigita.
Click Next

Select Dedicated Server Mode
Click Next

Leave all options ticked.
Click Next

Enter ora816 as the Global Database Name.
The SID should be fill in automatically to be the same.
Leave the other options alone.
Click Next

If you're just playing, leave the control files and max. settings alone. You should really spread your control files across different disks though. If you don't have enough disks, use separate directories anyway - it'll make the installation of new disks easier when you get them.
Click Next

If you're playing you can leave the default sizes for the tablespaces. Otherwise, here are some recommended sizes:

Tablespace NameSize (Mb)
System200
Index200
Temporary150
Rollback516
Intermedia150

Click Next

Again, only if you're serious, increase the three Redo Log files to 10000Kb. As with the control files, split these over 3 disks if you can, or at least 3 directories.
Click Next

Leave the logging parameters alone.
Click Next

Increase "Processes" to 100 and change the block size to 4096.
Click Next

Leave the trace files alone.
Click Next

Select Save information to a shell script
Click Finish

This will help you understand what is happening in the background and help you diagnose any problem during database creation.
In the save dialogue, click OK.
OK everything else.

Edit init.ora - this is only necessary if you intend to install the ACS

Add the following line to $ORACLE_HOME/dbs/initora816.ora:
nls_date_format = "YYYY-MM-DD"
Also change the line the setting for open_cursors:
open_cursors = 500

Run the scripts

The scripts can be found in $ORACLE_HOME/assistants/dbca/jlib. You only need to run sqlora816.sh which calls each of the other scripts, but it's best to try the first one on its own just so you know it isn't going to fall at the first hurdle.

sqlora816.sh sets two environment variables before running the scripts, but these are already set in our profile, so we're safe to call the other scripts individually.

Edit sqlora816.sh and comment out the first script:

#./ora816run.sh
Now run this script manually from the prompt:
./ora816run.sh
If you can't hear the hard disk, you might think that svrmgr has crashed. You'll see a line with
2>    3>    4>    
...etc. and the cursor at the end. Get used to this lack of feedback :) All it will tell you is "Statement processed." and any errors.

It takes about a minute for this script to finish. Hopefully you'll get no error messages, in which case you can run the rest of the scripts with

./sqlora816.sh
Don't worry about the "does not exist" messages. It's just dropping objects before it creates them.

My machine took 1hr 22mins.


4. Post Database Creation Procedures

I've ripped this straight out of the ArsDigita version of this document. Sorry, I haven't had a chance to test it yet.

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.

Your installation of Oracle 8.1.6 is complete. Congratulations.


Michael Hinds, Brian Fenton, Kevin Crosbie, Aug 2001