Instructions for Oracle install on RedHat Linux AS3
by Mahdi Sajjadpour

Do a custom install of RedHat AS3. You need to have the following packages
* X Window System
* Editors (Also select vim-X11)
* Graphical Internet (ONLY mozilla)
* Text-based Internet
* Server Configuration Tools
* Development Tools
* Kernel Development
* X Software Development
* Legacy Software Development
* Administration Tools
* System Tools

I set a /data partition w/ext3 for my data directory. This partition will only hold the Oracle data (db) files.

groupadd dba
groupadd oinstall
groupadd oper
groupadd apache
useradd -c "Oracle software owner" -g oinstall -G dba oracle
passwd oracle
oracle

useradd -g oinstall -G apache apache
passwd apache
apache



Change Startup Params

vi /etc/sysctl.conf

add the following lines to the end of the file.
Note: this depends on the box memory, the settings below are for a 2G box.

#oracle tweaks
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
vi /etc/security/limits.conf
add the following lines to the end of the file:

#oracle tweaks
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
now reboot the box.


Install Oracle

Most of this documentation is from (http://www.puschitz.com/InstallingOracle9i.shtml). Installation files go in /opt/oracle/oraInventory, Installed files go in /opt/oracle, and database files go in /data.
Allow other users to use X Window (run as current user)
xhost +localhost
Setup users and directories
mkdir /opt/oracle
mkdri /opt/src
mkdir /opt/oracle/product
mkdir /opt/oracle/product/9.2.0
chown -R oracle.oinstall /opt/oracle


mkdir /var/opt/oracle
chown oracle.dba /var/opt/oracle
chmod 755 /var/opt/oracle

mkdir /opt/src
mkdir /opt/src

Mess with gcc
mv /usr/bin/gcc /usr/bin/gcc323
ln -s /usr/bin/gcc296 /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++323
ln -s /usr/bin/g++296 /usr/bin/g++

Setup Oracle
* Copy the software to /opt/src/Oracle_9i_Database_Release_2 from wherever you have it. I have it on a network mount.
cp -r /mnt/ntwkmnt/software/Oracle/Oracle\ 9i\ Database\ Release\ 2 Linux /opt/src/Oracle_9i_Database_Release_2
cd /opt/src/Oracle_9i_Database_Release_2
unzip p3006854_9204_LINUX.zip
cd 3006854
sh rhel3_pre_install.sh
cd ..
chown -R oracle:dba .
su - oracle
cd /opt/src/Oracle_9i_Database_Release_2/Disk1

Set configuration (save to /home/oracle/.bash_profile)
export LD_ASSUME_KERNEL=2.4.1
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2.0
export PATH=$PATH:$ORACLE_HOME/oracm/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export ORACLE_SID=BUILDCLE
export ORACLE_TERM=vt100
export NLS_LANG=AMERICAN;
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
Install Oracle
export DISPLAY=localhost:0.0

./runInstaller

(Welcome Screen) Next
(File Locations) Use default values
(Unix Group Name) Use "oinstall" and click Next
(Popup) When asked to run /tmp/orainstRoot.sh, run it before you click Continue
(File Locations) Use default values
(Available Products) Select "Oracle9i Database 9.2.0.4.0"
(Installation Types) Select Custom
(Available Products) Add iSQL*Plus and Oracle JDBC/OCI Interfaces if you will need it.
(Components Locations) Accept default values and click Next
(Privileged Operating System Groups) I used the default values: OSDBA Group = dba, OSOPER Group = dba
(Oracle Managent Server Repository) I used the default choice
(Create database) Select NO since we first have to patch Oracle before a database can be created!
(Summary) Start the Install
(Setup Privileges Popup) Go to command line as root
/opt/oracle/product/9.2.0/root.sh
/usr/local/bin
LSSV Installation failed because of libcurses.so.4, simply ignore.
(Configuration tools) Tools won't come up. Simply ignore it.
At the end of the installation, exit runInstaller.
Patch runInstaller
cp p3095277_9204_LINUX.zip /tmp
cd /tmp
unzip p3095277_9204_LINUX.zip
cpio -idmv < 9204_lnx32_release.cpio
cd Disk1
./runInstaller
(Welcome Screen) Click Next
(File Locations) Use default values
(Available Products) Select "Oracle Universial Installer 2.2.0.18.0 !"
(Components Locations) Accept default values and click Next
(Summary) Start the Install
At the end of the installation, you must exit runInstaller!
Patch Oracle
cd $ORACLE_HOME/bin
./runInstaller
(Welcome Screen) Click Next
(File Locations) Use default values
(Available Products) Select "Oracle9iR2 Patch Set 3 9.2.0.4.0 !"
(Summary) Start the Install
At the end of the installation, exit runInstaller
I had problems with this, it told me that a later patch was already in place, ignored it.

More Oracle Patches

cd /opt/src/Oracle_9i_Database_Release_2/
cp p2617419_220_GENERIC.zip /opt/oracle/
cd /opt/oracle
unzip p2617419_220_GENERIC.zip (you should see a new directory called OPatch)
rm p2617419_220_GENERIC.zip
PATH=$PATH:/opt/oracle/OPatch:/sbin
export PATH


cp /opt/src/Oracle_9i_Database_Release_2/p3119415_9204_LINUX.zip /tmp
cd /tmp
unzip p3119415_9204_LINUX.zip
cd cd 3119415/
opatch apply

(type in Y)

Almost There

ok now we are almost done. Need to install a database and then take it from there.
make the PATH entry look like this:
su - root
mkdir /data/oracle/
chown -R oracle:dba /data/oracle/
logout


login as oracle or su - oracle
PATH=$PATH:$HOME/bin:/opt/oracle/product/9.2.0/bin
. .bash_profile
dbca
(Database Configuration Assitant will come up)
Next
Create a Database -> Next
New Database -> Next
Global Database Name should be the name of the BOX (e.g. APPLE in this example). -> Next
Database Features -> accept default (all checked) -> Next
Dedicated Server -> Next
Memory Config/Othe Config Tabs -> Accept defaults (will change later) -> Next
on this screen you will see where it says "Database Storage"
On the left side, there is a tree listing of the db components
expand the one that says Datafiles, You will see a listing of Tablespaces starting with CWMLITE -> XDM
Click on each Datafile, depending on where we want the data directory, change the File Directory location (by double clicking on it)
for each tablespace. DO NOT change the file name itself (just the preceeding directory).
For my boxes, the data directory is /data/oracle/{DB_NAME}/, really depends on how you want to design your box.... Its always a good idea to keep the data files in a separate partition.
Once you have completed changing the path for all the data files, expand the Tablespaces branch (above Datafiles). Click on the USERS tablespace. Click on the Storage Tab, unclick the Automatically increment db.
Go back to the main tab and set the db size to 25000M.
Once you have completed the Process -> Next
Create Database -> Finish
You will get a popup with all the info. Click Ok.
You will get another popup with a "Database Creation" process bar, it will take about 20-30 minutes for it to complete.
It will give you two popup errors, one about a missing operator and one about something else, click Ignore.
At the end of the process, it will ask you to submit the password for the SYS and SYSTEM username. Please do not place simple passwords.
cp /opt/src/Oracle_9i_Database_Release_2/p3238244_9204_LINUX.zip /tmp
cd /tmp
unzip p3238244_9204_LINUX.zip
PATH=$PATH:/opt/oracle/OPatch:/sbin
export PATH
cd 3238244
opatch apply
find $ORACLE_HOME -name "*.mk" | xargs grep -l dbsnmp
should get /opt/oracle/product/9.2.0/network/lib/env_oemagent.mk
/opt/oracle/product/9.2.0/network/lib/ins_oemagent.mk
cd $ORACLE_HOME/network/lib
make -f ins_oemagent.mk install
now start the oracle agent
agentctl start

You should get any error messages, you will see the following message on the console
DBSNMP for Linux: Version 9.2.0.4.0 - Production on 15-JUN-2005 10:43:20

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

Starting Oracle Intelligent Agent....
Agent started
at this point you are done w/the install, now you need to setup oracle for startup.

Configure for take off

setup oratab file
su - root
vi /etc/oratab
you will see the following:
*:/opt/oracle/product/9.2.0:N
change it to:
APPLE:/opt/oracle/product/9.2.0:Y
where APPLE is the name of the DB instance you created. create a startup file
su - root
vi /etc/init.d/dbora


(Add the following lines)
#!/bin/sh
# chkconfig: - 20 80
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/opt/oracle/product/9.2.0
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart &"
sleep 5;
su - $ORA_OWNER -c "$ORA_HOME/bin/tnslsnr &"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut &"
;;
esac

Use chmod to set the privileges to 750:
chmod 750 /etc/init.d/dbora

Link the file into the appropriate run-level script directories:
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc5.d/S99dbora

Associate the dbora service with the appropriate run levels:
chkconfig --level 345 dbora on

Now move back the old GCC and G++ links
rm -f /usr/bin/gcc
rm -f /usr/bin/g++
ln -s /usr/bin/gcc323 /usr/bin/gcc
ln -s /usr/bin/g++323 /usr/bin/g++

ok now we are almost done w/the install. One thing you need to make sure is that the ORACLE_SID env variable for the oracle user is correct. so
vi /home/oracle/.bash_profile
export ORACLE_SID=NAME_OF_YOUR_DB

if its not the same name as your SID, then you need to logout and log back in again. Once you have done that:

sqlplus /nolog
SQL> connect sys as sysdba
Connected to idle instance
SQL>startup
ORACLE instance started.

Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.

SQL> create pfile='/opt/oracle/product/9.2.0/dbs/initNAME_OF_YOUR_DB.ora' from spfile = '/opt/oracle/product/9.2.0/dbs/spfileNAME_OF_YOUR_DB.ora'
File Created.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> exit

now we are ready for take off. We still have to configure the emca. But first
reboot

EMCA

Ok, so once the box comes up, make sure that oracle is running, ps -ef | grep oracle should give you back some oracle instances. If not, you need to do some troubleshooting :)
ok now we are have to build the Oracle Enterprise Manager (OEM)
emca
a Screen will popup
Click Next
Configure Local Oracle Managment Server -> Next
Create a New Repository -> Next
Custom -> Next
In another Existing Database -> Next
put in the u/p for SYS and the SID info -> Next
next screen, leave the OEM username as is and change the password (I set it to the same thing as the SYS passwd) -> Next
Accept defaults -> Next
Finish
a popup will come up w/a progress bar. Once it is done, the oem is setup. The window will close by itself.
ok now, you can start the OEM.
oemctrl start oms
OEMCTL for Linux: Version 9.2.0.1.0 Production
Copyright (c) 1998, 2002, Oracle Corporation. All rights reserved.
Starting the Oracle Management Server....
The OMS is now started and ready.

oemapp console
and you will have the OEM up, launch as standalone and you can add users/do other stuff..etc.
At this point you are on your own. The oracle server is up and running

Celebrate!

do as you please, just celebrate and dont run around naked in the office.

Copyright by techTips