Oracle 10gR2 installation on SUSE Linux Enterprise Server 9 (using scripts)

This scripts simplify installation with 'orarun' package, fixing few minor problems and automating all necessary steps. Next release of 'orarun' can eliminate any need in these scripts.

This scripts implement all operations, described in original document from SUSE Linux

Preparation.

You will need for installation:

Download and unzip oracle 10 R2 for Linux i386 or for x86_64, depending of your platform. Follow instructions on Oracle and obey licensing. Make this directory available for your new server (I use NFS).

Installation steps

Your scripts can be different, because they are updated each month to follow oracle and linux changes. Use this document as a reference and always check real script content before running it.

Files.

Files are here only for information. Always copy scripts and use them.
File CONFIG.sh:
#
# This is configuration file for install
#
RPMs=`/bin/pwd`/../RPMs
ORACLE10=`/bin/pwd`/../../Oracle10.2-i386/database
ORA10CD1=$ORACLE10
RPMORARUN=$RPMs/orarun-1.8-109.15.i586.rpm
ORAID=10.2.0
SID=test
File 010-install-orarun.sh:
#!/bin/bash
#	Install orarun package
#
. CONFIG.sh
rpm -U $RPMORARUN

passwd oracle
chsh -s /bin/bash oracle

File 015-edit-oraprofile.sh:
#!/bin/bash
#
#	Edit /etc/sysconfig/oracle.sh and oracle.sh
#
. CONFIG.sh
cd /etc/profile.d
for i in oracle.sh oracle.sh
do
test -f $i-orig || cp $i $i-orig
sed "s/9ir2/$ORAID/g;s+2.2.5+2.4.21+g;s/mydb/$SID/g;" $i > $i- && cp $i- $i && rm $i-
chown oracle $i
ls -l $i
done
File 020-start-rcoracle.sh:
#!/bin/bash
#
#	Run rcoracle to set up kernel parameters
#
. CONFIG.sh
rcoracle start
File 030-check-oracle-user.sh:
#!/bin/bash
#	Check oracle user setting
#
. CONFIG.sh
if [ ! -x $ORA10CD1/runInstaller ]
then
	echo -e "\33[31m *** Wrong oracle disk location - no file $ORA10CD1/runInstaller  found \33[30m"
	exit 1
fi
echo "*** CHECK ORACLE VARIABLES *** "
sux - -c "env" oracle | grep ORACLE
File 040-run-installer.sh:
#!/bin/bash
#	Run oracle installer as ORACLE user
#
. CONFIG.sh
sux - -c "cd $ORA10CD1 && ./runInstaller" oracle
echo -e "\33[33m *** Now , install oracle. Use defaults. ***\33[30m"
echo -e "\33[33m *** Create database instance $SID       ***\33[30m"
echo -e "\33[33m !!! Run 042-run-rootsh.sh when requested to run orainstRoot.sh. !!! \33[30m"
File 042-run-rootsh.sh:
#!/bin/bash
#
#	Running orainstallRoot.sh for Oracle Inventory
#
. CONFIG.sh
sh ~oracle/oraInventory/orainstRoot.sh

File 044-rootagain.sh:
#!/bin/bash
#
#	Running orainstallRoot.sh for Oracle Inventory
#
. CONFIG.sh
sh ~oracle/product/$ORAID/root.sh

File 050-edit-sysconfig.sh:
#!/bin/sh
#	
#	Edit /etc/sysconfig/oracle AND /etc/init.d/oracle after all
#       replace oracle startup files
. CONFIG.sh
#
# Ediit system configuration for Oracle
#

cd /etc/sysconfig
mkdir -p ORIG
test -f ORIG/oracle || cp oracle ORIG/oracle
sed '/START_ORACLE_DB=/s/no/yes/;/START_ORACLE_DB_LISTENER/s/no/yes/;/START_ORACLE_DB_CMANAGER/s/no/yes/;s/START_ORACLE_DB_CMANAGER/START_ORACLE_DB_EMANAGER/g' oracle > oracle- && mv oracle- oracle

#
# Now, replace rcoracle startup script (/etc/init.d/oracle
#
cd /etc/init.d
mkdir -p ORIG
test -f ORIG/oracle && cp oracle ORIG/oracle
# sed 's+2.2.5+2.4.21+g;s/Connection Manager/Enterprise Manager/g;s/CManager/EManager/g;s/ORACLE_DB_CMANAGER/ORACLE_DB_EMANAGER/g;s/cmctl start/emctl start dbconsole/g;s/cmctl stop/emctl stop dbconsole/g;s/cmctl status/emctl status dbconsole/g;s/cmctl/emctl/g;' oracle > oracle-  && cp oracle- oracle && rm oracle-
cp FILES.d/rcoracle /etc/init.d/oracle

#
# I recommnd to edit dbstart file. We will not do it here,
# because this operation depends of Oracle version and can easily change
#
# test -f /opt/oracle/product/$ORAID/bin/dbstart.orig || cp /opt/oracle/product/$ORAID/bin/dbstart /opt/oracle/product/$ORAID/bin/dbstart.orig
# cp FILES.d/dbstart /opt/oracle/product/$ORAID/bin/dbstart
#
 

cd /etc
sed "/$SID/s/N/Y/" oratab > oratab- && cp oratab- oratab && rm -f oratab-

#
# Now add symlink because dbstart have a bug
#
rm -f /var/opt/oracle/oratab
mkdir -p /var/opt/oracle
chown oracle /var/opt/oracle
ln -s /etc/oratab /var/opt/oracle/oratab



File 060-start-oracle.sh:
#!/bin/sh
. CONFIG.sh
rcoracle start
File 100-config-css.sh:
#!/bin/bash
#
#	Run script to configure CSS daemon
#	
. CONFIG.sh
ORACLE_HOME=~oracle/product/$ORAID/
$ORACLE_HOME/bin/localconfig add
css=`grep init.css /etc/inittab`
ed /etc/inittab <