Friday, June 27, 2008

Installing Oracle 10g on Ubuntu Feisty

Below instraction is originally from Oracle tutorial site for debian. However, it works with Ubuntu (because ubuntu is from debian) and successfully installed as what below instraction said. There is few area I made modification due to confusion.

+install following packages:
sudo apt-get install gcc make binutils libmotif3 lesstif2 rpm libaio1 libdb3

For post-install configuration login as root
+ create the following groups
--------------------------------------------
via 'System Settings > Users & Groups' or
# sudo groupadd oinstall
# sudo groupadd dba
# sudo groupadd nobody

+ create OS user oracle with group 'oinstall', secondary group 'dba', home /opt/oracle and shell
/bin/bash and set the passwd (make sure you remember this password)
via "System Settings > Users & Groups' or
# sudo useradd -g oinstall -G dba,nobody -d /opt/oracle -s /bin/bash oracle

+ set user oracle's password
# sudo passwd oracle

+ Append user oracle's bash profile with PATH and ORACLE:BASE,HOME and SID information
# vi /opt/oracle/.bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_PATCH=$ORACLE_HOME/OPatch
export ORACLE_SID=
export ORACLE_TERM=xterm

PATH=$PATH:/usr/sbin
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH

export PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:.

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

+ Create the directory for the software installation and assign ownership to oracle:oinstall
# chown -R oracle:oinstall /opt
# chmod -R 775 /opt

+ Make sure the correct kernel parmeters are appended to sysctl.conf
# vi /etc/sysctl.conf (these can be easily copied from the Quick Installation Guide
for Linux x86 doc on the Oracle10g CD)
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

+ set the kernel parameters or reboot
# /sbin/sysctl -p

+ set security limits
# vi /etc/security/limits.conf
(and append the following values to the end of the file)
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536

+ create symbolic links and camoflage Ubuntu to look more like an enterprise rpm based distro,
because the oracle installer is expecting rhel, sles or asianux based distros.
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so
# ln -s /usr/bin/basename /bin/basename

Login in to xwindows session as user oracle
-------------------------------------------
+ Mount the Oracle10g CD and run the installer
copy the /media/cdrom/database contents to the hard disk
$ cp -r /media/cdrom/database .
$ cd /database
$ ./runInstaller -ignoreSysPrereqs

As root # vi /etc/oratab change :N to :Y
+ This enables the oracle user to dbshut, dbstart and lsnrctl start

Hope this helps. Happy coding :)

No comments: