oracle11g suse10sp1 安装准备

来源:互联网 发布:平价好用的面霜知乎 编辑:程序博客网 时间:2024/05/17 01:15

#!/bin/bash

#In the /etc/sysctl.conf file,and then enter the following information at the end of the file
more /etc/sysctl.conf |grep 'installing Oracle Database 11g'
if [ $? -ne 0 ]
then
    echo '#Linux kernel parameters for installing Oracle Database 11g
fs.file-max = 102540
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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'>> /etc/sysctl.conf
fi
#Run the following command for the changed parameters to take effect
/sbin/sysctl -p
#Run the following command for the system to access the /etc/sysctl.conf file during the startup
/sbin/chkconfig boot.sysctl on
#In the Terminal window, run the following command to create the oinstall user group.
groupadd oinstall
#Run the following command to create the user group dba.
groupadd dba
#Run the following command to create the user oracle, and to allocate group dba and group oinstall for the user oracle.
useradd -g dba -G oinstall -d /opt/oracle oracle
echo "oracle"|passwd --stdin oracle
mkdir -p /home/oracle
chown  oracle:oinstall  /home/oracle
mkdir -p /opt/oracle
chown oracle:oinstall  /opt/oracle
#mkdir -p /home/software
#mkdir -p /home/software/oracle

if [ ! -d /home/software/oracle]
then
   mkdir -p /home/software/oracle
fi
chown -R oracle:oinstall /home/software/oracle

if [ ! -d /oradata/mos5200 ]
then
mkdir -p /oradata/mos5200
fi
chown oracle:oinstall /oradata/mos5200

#if exist,dont insert 
more /etc/security/limits.conf | grep 'Setting Shell Limits for the User Oracle'
if [  $? -ne 0 ]
then
echo '#Setting Shell Limits for the User Oracle
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536' >>/etc/security/limits.conf
fi
#查看session required pam_limits.so,如果存在,则加入
more /etc/pam.d/login | grep 'session required pam_limits.so'
if [  $? -ne 0 ]
then
echo 'session  required       pam_limits.so'>>/etc/pam.d/login
fi
#存在
more /etc/profile | grep 'oracle'
if [  $? -ne 0 ]
then
echo 'if test $USER = "oracle"; then
    if test $SHELL = "/bin/ksh"; then
        ulimit -p 16384
        ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi'>> /etc/profiles
fi

more /opt/oracle/.profile | grep 'ORACLE'
if [ $? -ne 0 ]
then
echo 'export ORACLE_HOSTNAME=mos5200app
export ORACLE_SID=mos5200
export ORACLE_BASE=/opt/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/mos5200
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
PATH=$PATH:/$ORACLE_HOME/bin:$HOME/bin:
export CLASSPATH PATH' >> /opt/oracle/.profile
su -c 'source /opt/oracle/.profile ' oracle
chown oracle:oinstall  /opt/oracle/.profile
fi

path=`pwd`
rpm -ivh $path/oracle_rpm/binutils-2.16.91.0.5-23.20.x86_64.rpm
rpm -ivh $path/oracle_rpm/compat-libstdc++-5.0.7-22.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/gcc-4.1.2_20070115-0.11.x86_64.rpm
rpm -ivh $path/oracle_rpm/gcc-c++-4.1.2_20070115-0.11.x86_64.rpm
rpm -ivh $path/oracle_rpm/gd-2.0.32-23.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/gd-devel-2.0.32-23.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/glibc-2.4-31.30.x86_64.rpm
rpm -ivh $path/oracle_rpm/glibc-devel-2.4-31.30.x86_64.rpm
rpm -ivh $path/oracle_rpm/glibc-devel-32bit-2.4-31.30.x86_64.rpm
rpm -ivh $path/oracle_rpm/plotutils-2.4.1-591.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/gnuplot-4.0.0-20.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/ksh-93r-12.28.x86_64.rpm
rpm -ivh $path/oracle_rpm/libaio-0.3.104-14.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/libaio-devel-0.3.104-14.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/libelf-0.8.5-47.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/libgcc-4.1.2_20070115-0.11.x86_64.rpm
rpm -ivh $path/oracle_rpm/libmudflap-4.1.2_20070115-0.11.x86_64.rpm
rpm -ivh $path/oracle_rpm/libstdc++-4.1.2_20070115-0.11.x86_64.rpm
rpm -ivh $path/oracle_rpm/libstdc++-devel-4.1.2_20070115-0.11.x86_64.rpm
rpm -ivh $path/oracle_rpm/make-3.80-202.2.x86_64.rpm
rpm -ivh $path/oracle_rpm/sysstat-6.0.2-16.19.x86_64.rpm
rpm -ivh $path/oracle_rpm/unixODBC-2.2.11-21.4.x86_64.rpm
rpm -ivh $path/oracle_rpm/unixODBC-devel*