Oracle/Database/Oracle Power Install Script (Oracle 11g - RHEL 5)


 * 1)             ORACLE POWER                         #
 * 2)    ORACLE 11g with RHEL 5 Power Installer        #
 * 3)         Written and maintained by                #
 * 4)  Kenneth Burgener              #
 * 1)  Kenneth Burgener              #

echo "=== ORACLE POWER ===" echo "" echo -n "Srini, are you ready to be amazed? [Y]: " read srini if [ -z $srini -o $srini = "Y" -o $srini = "y" ] ; then echo "" else echo "Tough luck, here it comes!" fi

grep "Red Hat Enterprise Linux Server release 5" /etc/issue if [ $? -ne 0 ] ; then echo "ERROR: This script is designed to run on RHEL 5!" exit 1 fi

if [ -e /etc/oraclepower ] ; then echo "ERROR: Oracle Power has already been executed!" exit 1 fi

touch /etc/oraclepower if [ $? -ne 0 ] ; then echo "ERROR: Run Oracle Power as root!" exit 1 fi

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
 * 1) configure hosts
 * 1) configure hosts

cat >> /etc/sysctl.conf <<EOF
 * 1) configure kernel parameters
 * 1) configure kernel parameters

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

/sbin/sysctl -p

cat >> /etc/security/limits.conf <> /etc/pam.d/login <<EOF
 * 1) Configure pam.d
 * 1) Configure pam.d

session   required     pam_limits.so
 * 1) Oracle Settings

EOF

groupadd oinstall groupadd dba useradd -g oinstall -G dba oracle echo "test12" | passwd --stdin oracle
 * 1) Configure Users and Groups
 * 1) Configure Users and Groups
 * 1) give password to oracle user 'test12'
 * 2) passwd oracle

mkdir -p /opt/oracle chown -R oracle.oinstall /opt/oracle mkdir /opt/oraInventory chown -R oracle.oinstall /opt/oraInventory
 * 1) Create directories
 * 1) Create directories

cat >> /home/oracle/.bash_profile <<"EOF"
 * 1) Configure Oracle profile
 * 1) Configure Oracle profile

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

export ORACLE_BASE=/opt/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.1/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

cat >> /etc/sysconfig/vncservers <<EOF
 * 1) Configure VNC Server
 * 1) Configure VNC Server

VNCSERVERS="1:oracle" VNCSERVERARGS[2]="-geometry 1024x768"

EOF

mkdir -p /home/oracle/.vnc echo "de2e2c59eda77881" | xxd -p -r - /home/oracle/.vnc/passwd chmod 600 /home/oracle/.vnc/passwd chown -R oracle:oinstall /home/oracle/.vnc

chkconfig vncserver on service vncserver start

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:

echo "Thank you for using..." echo "" echo "ORACLE POWER!!!" echo "ORACLE POWER!!!" echo "ORACLE POWER!!!" echo "ORACLE POWER!!!" echo "ORACLE POWER!!!" echo "ORACLE POWER!!!" echo "ORACLE POWER!!!" echo "ORACLE POWER!!!" echo "ORACLE POWER!!!"
 * 1) ORACLE POWER
 * 1) ORACLE POWER

echo "" echo "[you may know install Oracle]" echo ""


 * 1)             ORACLE POWER                         #
 * 2)    ORACLE 11g with RHEL 5 Power Installer        #
 * 3)         Written and maintained by                #
 * 4)  Kenneth Burgener              #
 * 1)  Kenneth Burgener              #