Oracle/Database/Oracle 10g RHEL5 Install

kickstart
/etc/yum.repos.d/oeey-rhel.repo: cat > /etc/yum.repos.d/oeey-rhel.repo << "EOF"

[oeey-rhel5.1] name=RHEL-$releasever - Server Base baseurl=http://216.119.202.4/rhel/$releasever/$basearch/Server/ gpgcheck=1 gpgkey=http://216.119.202.4/rhel/RPM-GPG-KEY-redhat-release

EOF

You will need to rebuild repodata to get this to work: createrepo.

Disable RHN: sed -i 's/enabled = 1/enabled=0/' /etc/yum/pluginconf.d/rhnplugin.conf
 * 1) vi /etc/yum/pluginconf.d/rhnplugin.conf
 * 2) enabled = 0

Install dependencies: yum install compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-devel \ glibc-common gcc-4.1.1 gcc-c++-4.1.1 kernel-headers libgcc-4.1.1 libaio libaio-devel \ libstdc++ libstdc++-devel unixODBC unixODBC-devel sysstat binutils make libXp

Missing from kickstart: yum install libaio-devel sysstat unixODBC unixODBC-devel libXp
 * 1) i386

yum install libaio-devel.x86_64 sysstat.x86_64 unixODBC.x86_64 unixODBC-devel.x86_64
 * 1) x86_64

Hosts
cp /etc/hosts /etc/hosts.original echo -e "127.0.0.1\t\tlocalhost.localdomain localhost" > /etc/hosts echo -e "`ifconfig | grep "inet addr" | head -n 1 | cut -f 2 -d ":" | cut -f 1 -d " "`\t\t`hostname` `hostname | cut -f 1 -d '.'`" >> /etc/hosts

The /etc/hosts file must contain a fully qualified name for the server: 127.0.0.1		localhost.localdomain localhost
 * 1			localhost6.localdomain6 localhost6

10.10.10.10		ws-194-130.oeey.com ws-194-130

WARNING: If during the precheck you get a "not executed" instead of a "success" or "warning" your hosts file is wrong!

Kernel Parameters
Add the following lines to the /etc/sysctl.conf file - cat >> /etc/sysctl.conf <<EOF

kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 262144
 * 1) Oracle Settings
 * 2) Only change default kernel.shmall and kernel.shmmax if pre-existing values
 * 3)   are lower then listed below:
 * 4) kernel.shmall = 2097152
 * 5) kernel.shmmax = 536870912
 * 1) kernel.shmmax = 536870912
 * 1) semaphores: semmsl, semmns, semopm, semmni
 * 1) memory settings

EOF

Run the following command to change the current kernel parameters: /sbin/sysctl -p

limits
Add the following lines to the /etc/security/limits.conf file: cat >> /etc/security/limits.conf <> /etc/pam.d/login <<EOF

session   required     pam_limits.so
 * 1) Oracle Settings

EOF

Users and Groups
Create the new groups and users and set password: groupadd oinstall groupadd dba groupadd oper useradd -g oinstall -G dba oracle echo "test12" | passwd --stdin oracle
 * 1) give password to oracle user 'test12'
 * 2) passwd oracle

Create the directories in which the Oracle software and database files will be stored: mkdir -p /opt/oracle chown -R oracle.oinstall /opt/oracle mkdir /opt/oraInventory chown -R oracle.oinstall /opt/oraInventory

Add the following lines at the end of the Oracle user's .bash_profile file: cat >> /home/oracle/.bash_profile <<"EOF"

export TMP=/tmp export TMPDIR=$TMP
 * 1) Oracle Settings

export ORACLE_BASE=/opt/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export ORACLE_SID=orcl export ORACLE_TERM=xterm export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jdk/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

EOF

Hack OS Version
This is an important step. If you miss this Oracle will complain about OS Version comparability. This can be undone, once Oracle has been installed.

cp /etc/redhat-release /etc/redhat-release.bak echo "redhat-4" > /etc/redhat-release

VNC
Add to the /etc/sysconfig/vncservers file cat >> /etc/sysconfig/vncservers <<EOF

VNCSERVERS="2:oracle" VNCSERVERARGS[2]="-geometry 800x600"

EOF

Log into the oracle user and create VNC Password su - oracle vncpasswd ; exit
 * 1) give vnc login a password 'test12'

Enable VNC persistent desktops at boot and start service chkconfig vncserver on service vncserver start

Remove # from /home/oracle/.vnc/xstartup to enable full desktop sed -i 's%# unset SESSION_MANAGER%unset SESSION_MANAGER%g' /home/oracle/.vnc/xstartup sed -i 's%# exec /etc/X11/xinit/xinitrc%exec /etc/X11/xinit/xinitrc%g' /home/oracle/.vnc/xstartup service vncserver restart
 * 1) restart vncserver to take effect:

This will result in: /home/oracle/.vnc/xstartup: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc
 * 1)  Uncomment the following two lines for normal desktop:

VNC to system: vncviewer [SYSTEM]:2

Install Oracle
unzip 10201_database_linux32.zip cat 10201_database_linux_x86_64.cpio | cpio -idmv cd database ./runInstaller
 * 1) copy oracle install local
 * 1) 32bit:
 * 1) 64bit:

Oracle Installation Details: Oracle Home Location: /opt/oracle/product/10.2.0/db_1 Installation Type: Enterprise Edition (1.3GB) UNIX DBA Group: oinstall Create Starter Database (additional 720MB) Global Database Name: orcl * Database Password: test12 Inventory directory: /opt/oracle/oraInventory Operating System group name: oinstall

During the prerequisite check you should only have the following issues:
 * swap - warning (due to small swap - ignore)
 * network - warning (due to dhcp address - fix by static ip)

If the network has "not run" check your hosts file. If anything else is error or warned, you have problems.

Database Control URL is: http://[HOST]:1158/em

root
Near the end of the install it will ask you to run the following root: /opt/oracle/oraInventory/orainstRoot.sh /opt/oracle/product/10.2.0/db_1/root.sh

Unhack OS Version
mv /etc/redhat-release.bak /etc/redhat-release

Enterprise Manager
The following J2EE Applications have been deployed and are accessible at the URLs listed below.

iSQL*Plus URL: http://[HOSTNAME]:5560/isqlplus

iSQL*Plus DBA URL: http://[HOSTNAME]:5560/isqlplus/dba

Enterprise Manager 10g Database Control URL: http://[HOSTNAME]:1158/em

oracle init.d script
NOTE: Make sure to set the auto start flag for the database (/etc/oratab), or this will not work!


 * 1) !/bin/sh
 * 2) chkconfig: 345 99 10
 * 3) description: Oracle auto start-stop script.
 * 4) Set ORA_HOME to be equivalent to the $ORACLE_HOME
 * 5) from which you wish to execute dbstart and dbshut;
 * 6) Set ORA_OWNER to the user id of the owner of the
 * 7) Oracle database in ORA_HOME.
 * 8) Note: make sure to modify /etc/oratab start
 * 9) parameter from 'N' to 'Y'
 * 1) Note: make sure to modify /etc/oratab start
 * 2) parameter from 'N' to 'Y'
 * 1) parameter from 'N' to 'Y'

ORA_HOME=/opt/oracle/product/10.2.0/db_1 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/lsnrctl start"        su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"        ;;    '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 $ORA_HOME" su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" ;; esac

OS Version Failed
When you run ./runInstaller you may see the following:

Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2 Failed <<<<

Exiting Oracle Universal Installer, log for this session can be found at /tmp/OraInstall2009-11-04_10-35-25AM/installActions2009-11-04_10-35-25AM.log

This means you forgot to hack the version of red hat. See instructions above.

Swap Space Requirement
Checking available swap space requirements ... Expected result: 8112MB Actual Result: 1983MB Check complete. The overall result of this check is: Failed <<<< Problem: The system does not have the required swap space. Recommendation: Make more swap space available to perform the install.

Static IP Requirement
Checking Network Configuration requirements ... Check complete. The overall result of this check is: Failed <<<< Problem: The install has detected that the primary IP address of the system is DHCP-assigned. Recommendation: Oracle supports installations on systems with DHCP-assigned public IP addresses. However, the primary network interface on the system should be configured with a static IP address in order for the Oracle Software to function properly. See the Installation Guide for more details on installing the software on systems configured with DHCP.

keywords
oracle