PROMO SELL

Tuesday, March 08, 2005

Oracle 8i on Linux

This is a step by step guide to installing Oracle8i on Linux. The installation was successfully tested on Suse 6.4 , Redhat 6.2 and Caldera openLinux 2.4 using Oracle 8i Enterprise Edition Release 2 (8.1.6) for Linux (Intel) circa October 2000.

1.Installtion
2.Notes
3.Trouble Shooting

1.Installation

Download Java 1.1.6 ( JRE ) for Linux from www.java.sun.com/linux or from blackdown.org and Oracle 8i from oracle.com If you have the Oracle 8i CD download only the JRE.


[download the files to some directory like /tmp ]
$cd /tmp
$ls *.gz
jre_1.1.6-v5-glibc-x86.tar.gz
oracle8161_tar.gz

[ become root ]
$su

[ set up and install the jre ]
#cp /tmp/jre_1.1.6-v5-glibc-x86.tar.gz /usr/local/lib
#cd /usr/local/lib
#tar -xzvf jre_1.1.6-v5-glibc-x86.tar.gz
#ln -s /usr/local/lib/jre116_v5 /usr/local/lib/jre
#export PATH=$PATH:/usr/local/jre/bin

[ create user groups ]
#/usr/sbin/groupadd -g 111 oinstall
#/usr/sbin/groupadd -g 112 dba

[ create auser named oracle ]
#mkdir /home/oracle
#/usr/sbin/useradd -g dba -d /home/oracle oracle
#/usr/sbin/usermod -g dba -G oainstall oracle
#passwd oracle
#chown oracle /home/oracle
#chgrp dba /home/oracle

[ make some directories required during installtion ]
#mkdir -p /usr/local/oracle/8i && cd /usr/local/oracle/8i
#mkdir -p /usr/local/oracle/8i && cd /usr/local/oracle/8i
#mkdir {u01,u02,u03,u04}
#chown oracle:oinstall {u01,u02,u03,u04}


[ become user oracle ]
#su oracle
$cd
$pwd
/home/oracle
$

[ Create/Edit the file named /home/oracle/.bashrc
with the following contents : [ SEE NOTE 2]

ORACLE_HOME=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5
ORACLE_BASE=/usr/local/oracle/8i/u01/app/oracle
export ORACLE_HOME ORACLE_BASE
NLS_LANG='english_united kingdom.we8iso8859p1'
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
ORACLE_TERM=vt100
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin:/usr/local/jre/bin
export NLS_LANG ORA_NLS33 PATH LD_LIBRARY_PATH

$vi .bashrc
$source .bashrc

[ NO CD - unzip and extract the downloaded files ]
$gunzip /tmp/oracle8161_tar.gz
$tar -xvf /tmp/oracle8161_tar
$cd /tmp/Oracle8iR2/install/linux

[ WITH CD - If not mounted mount the CD ] [ SEE NOTE 1 ]
#su
#mount -t iso9660 /dev/hdc /cdrom
#exit
#su oracle
$cd /cdrom/install/linux


[ start installation ]
$./runInstaller

During installation the installation program will prompt you a couple of times to run certain commands as root from a shell. It will also ask you to create an SID at the end of the installation.

Post Install:

$svrmgrl
>connect internal
>startup

$export ORACLE_SID=your_sid_name
$sqlplus scott/tiger
SQL>
SQl>select ename from emp;

2.Notes
1. Mounting CD

The mount command might be little different on diferent machines the third parameter the device file for CDROM [ /dev/hdc ] may not be the same on all machines. Please contact your friendly sysadmin for help.

Or if you have an X desktop environment like Gnome or KDE you can click on the CDROM icon it might mount the CDROM and will open the CDROM contents in a file explorer.

Some Linux distributions ( like Caldera open Linux ) will have the CD auto mounted at /auto/cdrom. in that case you just go to that directory to access the installation files you dont have to mount the CD.

2. Adding the .profile/.login/.bashrc

Usually the default shell for new user accounts on Linux is bash. So the file to add Oracle environment variables is usually .bashrc in the home directory /home/oracle. But if you are running another shell please contact your friendly sysadmin to find out which file to edit.

If you are not familiar with vi , please use any of the notepad like editors gedit,kedit,nedit .
3.Troubleshooting
1. Make sure you have set the Oracle environment variables correctly.

$su oracle
$cd
$pwd
/home/oracle
$source .bashrc
$env | grep -E 'ORACLE|NLS|LD'
NLS_LANG=english_united kingdom.we8iso8859p1
LD_LIBRARY_PATH=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5/lib
ORACLE_BASE=/usr/local/oracle/8i/u01/app/oracle
ORA_NLS33=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5/ocommon/nls/admin/data
ORACLE_HOME=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5
$

Make sure the env command shows the above output, otherwise make sure you edited the /home/orcle/.bashrc file correctly.


2. Stale files from an aborted/failed installation

Sometimes the Oracle Universal Installer leaves behind stale files from an earlier failed installation as a different user.

One of the files left behind is /etc/oraInst.loc

#su
#cat /etc/oraInst.loc
inventory_loc=/home/user_name/oraInventory
inst_group=dba
#
[ where user_name is the user account from which the last failed installation was attempted ]

If you have this file hanging around you might get an error message saying no permissions to write /home/user_name/oraInventory . In that case become root and delete /etc/oraInst.loc file, and continue installation as user oracle.

No comments: