Installing Oracle9i on Linux

This article was published by Pipeline Newsletter, , in the "Oracle Administration" section of their September 2001 issue, as a lead article. It was their top-ranked article within the first week of publication.

Background

SDOUG is working with the Mission Bay High School on creating projects using databases that will be accessed through Oracle Portal. In addition, we want to create an Oracle Portal site for SDOUG. The prerequisite of all this is setting up a reliable server that is secure and can house the test databases.

This paper outlines all the steps we took to install Oracle9i on the server.

Hardware and Software Specifications:

Linux Version SuSE Version 7.2 Professional
Purchased on CD set
Oracle Database Oracle9i Ver. 9.1.0.1
Downloaded from OTN
Computer HP 6835 - Pentium Celeron 800 MHz
Memory Comes with 128 MB.
Replaced with two 256 MB chips
Storage Disk 1 - 30 GB
Disk 2 - Maxtor 80 GB, partitioned into four 20 GB segments
Server (Host) Name Chippy

Downloading and Unzipping the Software

There are three large files in the download: Linux9i_Disk1.cpio.gz, ...Disk2..., and ...Disk3... The instructions on the OTN (Oracle Technology Network) site tell you to use gunzip to get the "cpio" files. This worked fine for the first file, but failed on the second file. We downloaded the second file (449 MB) and tried again. No luck.

Solution: Unzip the files on a Windows 2000 machine. The unzipped files are: Linux9i_nojre_Disk1.cpio, Linux9i_nojre_Disk2.cpio, and Linux9i_nojre_Disk3.cpio. We then FTP'd these files onto the Linux server. From there, you can extract the files with cpio, using the following commands:

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

NOTE: Don't forget the "<" in front of the file name!

The cpio program will extract all the necessary files and create directories. When it's all done, you should have a "Disk1", "Disk2", and "Disk3" directory.

Pre-Installation Tasks

The more care you take in this step, the better your results will be! Our advice is to go slow, double-check all your work, and make sure you don't take any shortcuts.

Step 1: Install the JDK

Log on as root.

Create directories for the JDK:

mkdir /usr/local/java
                mkdir /usr/local/java/bin

Make sure FTP is running:

ps -ef | grep ftp

Go to http://java.sun.com/ to download the Java 1.2 SDK. The SDK is simply an enhanced JDK. The download is around 20 MB.

Unzip the tar file:

gunzip jdk-1_2_2_008-linux-i386.tar.gz
                ls -l

Result should be:

-rw-r--r--  1 root   root   47206400 Aug 15 17:02 jdk-1_2_2_008-linux-i386.tar

See if the file has relative or absolute paths inside it:

tar --list -f jdk-1_2_2_008-linux-i386.tar | more

Result: file has relative paths.

Go to directory where we want to install the SDK and un-tar the file:

cd /usr/local
                tar -xvf /home/tomscott/java_downloads/jdk-1_2_2_008-linux-i386.tar

Result: JDK should be extracted into the /usr/local/jdk1.2.2 directory.

Step 2: Linux Kernel Parameters

See if OS imposes any file size limit:

ulimit -f

Result: SUSE 7.2.4 is unlimited

Review kernel parameters:

cd /proc/sys/kernel
                cat sem

Result: 250 32000 32 128

These are the current values for SEMMSL, SEMMNS, SEMOPM, and SEMMNI. Oracle9i requires a minimum of 100 for SEMMSL, 256 for SEMMNS, 100 for SEMOPM, and 100 for SEMMNI. The only parameter we had to change was SEMOPM (32, vs. the required 100).

Change the kernel parameters:

echo 250 32000 100 128 > sem

Make sure the startup file in /proc/sys/kernel contains the new settings as well. Enter the following:

echo 250 32000 100 128 > /proc/sys/kernel/sem

Note that you have to give the full path to "sem" in the name of the startup file.

Review the shared memory parameter. The Oracle installation notes suggest that this should be 50% of your physical memory.

cat shmmax

Result: 33554432

Oracle needs 2147483648, so we do not have enough. To change, enter

echo 256000000 > shmmax

Add entry to startup file in /proc/sys/kernel as follows:

echo 2147483648 > /proc/sys/kernel/shmmax

Check value of SHMMNI:

cat shmmni

Result: 4096. We are OK, because Oracle only needs 100.

Verify oracle database admin groups:

cd /etc
                cat group

Results:

osdba:*:1001:
                osoper:*:1002:
                orainventory:*:1003:
                apache:*:1004:

These groups were created by the Linux install programs.

Add user oracle to osdba group using usermod:

usermod -g orainventory -G osdba oracle

Note that "-g" is for the primary group and "-G" is for the secodary group(s).

Check the results:

cat group

Results:

osdba:*:1001:oracle
                osoper:*:1002:
                orainventory:*:1003:
                apache:*:1004:

If user apache is not there, create apache user with useradd:

useradd -g orainventory -G apache -d /tmp -s /bin/bash -p apache_pwd apache

Note the "-p" parameter, which is for the apache password. In this example, it is "apache_pwd". Set this to whatever you want.

Make sure user apache is the only user in the apache group!

MOUNT POINTS: Not relevant to us, since all our files were on the hard disk on the Linux system.

Set up directories for database files. This example does NOT use OFA.

mkdir /opt/oracle/product
                mkdir /opt/oracle/product/9.0.1

Make sure user oracle can write to the directories:

chown -R oracle.orainventory /opt/oracle/*
                mkdir /var/opt/oracle
                chown oracle.osdba /var/opt/oracle

Verify there is a /user/local/bin directory and it is in the PATH for the oracle user. (If not, create the directory and add it to the PATH.)

su oracle
                echo $PATH

RESULT: /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin <---- OK!

Verify each user has execute permissions on the directory:

ls -dl /usr/local/bin

Result:

drwxr-xr-x  2 root   root  3

Now do the same for the apache user:

exit
                su apache
                echo $PATH

Result:

/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin

The path is OK. Now check execute permissions:

ls -dl /usr/local/bin

Result:

drwxr-xr-x  2 root   root  3

Set TMPDIR path with at least 20 MB of free space:

su oracle
                echo $TMPDIR
                TMPDIR=/tmp
                echo $TMPDIR

See if there is a .bash_profile for the oracle user:

cd
                ls -l

Result: there was no file there, so we had to create one.

One method to do this is the following 'here-doc' command:

cat /opt/oracle/.bash_profile <<< "EOF"
                # Create a .bash_profile
                ####### TEXT OF .bash_profile for oracle user
                # profile for Oracle9i installation user
                export ORACLE_HOME=/opt/oracle/product/9.0.1
                # add line below by uncommenting if necessary:
                # export ORACLE_BASE=/opt/oracle
                #
                export ORACLE_TERM=xterm
                export TNS_ADMIN=$ORACLE_HOME/config/9.0.1
                export NLS_LANG=AMERICAN-AMERICA.UTF8
                export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
                export PATH=$PATH:$ORACLE_HOME/bin:/usr/local/java/bin
                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
                EOF

Make sure you are still logged in as oracle and are in the oracle home directory.

su oracle
                pwd

Execute the .bash_profile script:

source .bash_profile

Verify the .bash_profile script ran by checking one of the environment variables set in the script:

echo $ORA_NLS33

Result should be that the environment variable has the value set in the script above.

Log on as root:

exit

Add server name to access control list:

xhost +chippy

You should get the following message back:

chippy being added to access control list

Note: Be sure you are logged on as root! If you are not, this won't work!

Set up the display for user oracle:

su oracle
                export DISPLAY=sci:0.0

Go to the "Disk1" directory that contains the runInstaller program for Oracle9i:

cd /home/orcl_Install/Disk1

This may be a good time to say a short prayer!

Install the Database

If you have done everything exactly right the Java-based Oracle Universal Installer will show up when you run the runInstaller program. If you goofed somewhere, the only way you will get runInstaller to work again is if you go to the /tmp directory and get rid of all the directories (there should not be more than a couple) the OUI set up there. Otherwise, you will execute runInstaller over and over, and nothing will happen.

Start the installer: ./runInstaller

StepDescriptionActionResults and Comments
1Initial ScreenClick "Next"Display Base Directory for Inventory Location
2Inventory Location ScreenClick "OK"Should default to /opt/oracle/oraInventory
3Unix Group Name windowClick "Next"Use this if you want a group other than root to be able to change Oracle settings. We left this blank, since we will always update Oracle software as root on this physical server.
4Script Popup Screencd /tmp
./orainstRoot.sh
Popup instructs you to run a script as root (remember, you are installing this as user oracle. Open another terminal session, log on as root, and run the commands to the left:
You should get a message back:
Creating Oracle Inventory pointer file (/etc/oraInst.loc)
5Popup windowClick "Continue"
6File Locations ScreenUse defaults; click "Next"These directories should have been created by "cpio" and by the scripts above.
7Available Products ScreenClick "Next"Wait cursor will show for a minute or so.
8Choose Edition ScreenSelect Enterprise Edition; click "Next"Whatever you do, avoid "Custom"
9Database Configuration ScreenClick "Next"Leave default configuration of "General Purpose".
10Privileged Operating System Groups ScreenUse defaults; click "Next"Default database administrator group is orainventory
Default database operator group is orainventory
11Database Identifier ScreenClick "Next"Choose Global Database Name and SID:
Global Name: chippydb.chipper
SID: chippydb
12Database character Set ScreenUse defaults; click "Next"
13JDK Home Directory ScreenEnter: /usr/local/jdk1.2.2
Click "Next"
Now you know why this was the first thing we installed.
14Summary ScreenPress "Install"
Say some more prayers...
The installations will take a couple of hours.
15Configuration Popup ScreenGo back to your terminal window where you are logged on as root
Run the script.
/opt/oracle/product/9.0.1/root.sh
This will first ask you the full path of the local bin directory, which should be: /usr/local/bin
The script will then add entries to the /etc/oratab file. When it is done, this message will appear:
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
16Installation ScreenPress "OK"
17Configuration Tools ScreenSee if everything completes successfully.

If you have problems, the installer will start three tools automatically:

All of these tools are optional and can be configured after the installation. The process ran all night, and by next morning, it was still on Oracle Net Configuration Assistant. The following appeared in the "details" section:

Parsing command line arguments:
                    Parameter "orahome" = /opt/oracle/product/9.0.1
                    Parameter "instype" = typical
                    Parameter "inscomp" = client,oraclenet,javavm,server,ano
                    Parameter "insprtcl" = tcp
                    Parameter "cfg" = local
                    Parameter "authadp" = NO_VALUE
                    Parameter "nodeinfo" = NO_VALUE
                    Parameter "responsefile" = /opt/oracle/product/9.0.1./network/install/netca_typ.rsp
                Done parsing command line arguments. Oracle Net Services Configuration:
                    Profile configuration complete.
                    Oracle Net Listener Startup:
                    Running Listener Control:
                    /opt/oracle/product/9.0.1/bin/lsnrctl start LISTENER

What we did:

18Configuration Tools ScreenClick "Stop"This cause the OUI to go onto starting the Web Server, which succeeded. The third step also succeeded.
19Installation ScreenClick on "Password Management" buttonIf Step 3 is successful, you will get the following message:
Note: All database accounts except SYS and SYSTEM have been locked. Click on "Password Management" button to unlock the accounts and change the default passwords
20Password Management ScreenUnlock accounts; change passwords
Click "OK"
Obviously, this depends on your own system requirements.
21Configuration Tools ScreenSelect Oracle Net Configuration AssistantTry to reconfigure this step. In our case, it worked!
22Verify DatabaseLog into Scott/Tiger from sqlplus.
Set up a TNS_Names entry and see if you can reach the database through its IP address.

Post-Installation Tasks

This is the easy part. We followed the Oracle documentation here. Don't forget to change the passwords for SYS, SYSTEM, etc!

Copyright © 2001 Tom Scott and Michael J. Ross. All rights reserved.
bad bots block