写的一个oracle安装前的准备的脚本,大家可以拿去修改修改使用

#!/bin/bash

主要从事网页设计、PC网站建设(电脑版网站建设)、wap网站建设(手机版网站建设)、自适应网站建设、程序开发、微网站、小程序制作等,凭借多年来在互联网的打拼,我们在互联网网站建设行业积累了丰富的做网站、网站制作、网络营销经验,集策划、开发、设计、营销、管理等多方位专业化运作于一体,具备承接不同规模与类型的建设项目的能力。

# echo "拷贝文件:"
# read -p "please input the server you share your os installation media and oracle software:" server
# mkdir /installyationMedia
# scp root@${server}:/iso/* /installationMedia
# if [ -e /installationMedia/*.iso ]{
#  echo "文件拷贝成功。"
# }else{
#  echo "操作系统文件拷贝不成功"
# }

echo "**********************Mount the iso******************************"
mount -o loop /tmp/rhel-server-6.0-x86_64-dvd.iso /media
cat >/etc/yum.repos.d/cd.repo<[cd]
name=cd.repo
baseurl=file:///media/Server
enabled=1
gpgcheck=0
EOF
yum clean
yum update
if [[ $? -eq 0 ]]; then
 echo "Yum repo configure success!"
 else
 echo "Yum repo configure failure!"
fi

echo "**********************Verify the dependency packages**************************"
for i in `cat package.txt`; do
 rpm -qa | grep ${i}
  if [[ $? -eq 0 ]]; then
   echo "${i} have been installed !" | tee -a log.txt
  else
   yum -y install ${i}*
   if [[ $? -eq 0 ]]; then
    echo "${i} Install Success;" | tee -a log.txt
   else
    echo "${i} install failure" | tee -a log.txt
   fi
  fi
done

echo "**********************unzip the packages*****************************"
if [[ -d /installationMedias/database ]]; then
 echo "Database Installation File have been created!"
else
 for i in `ls -l /installationMedias/linux*.zip | awk '{print $9}'`; do
  unzip ${i} -d /installationMedias
 done
fi


echo "************************Environment Prepare*******************************"
if [[ -d /u01/app ]]; then
 echo "/u01/app Directory Have Been Created!"
else
 mkdir -p /u01/app
fi

if [[ -z `cat /etc/group | grep dba` ]]; then
 groupadd dba
else
 echo "dba group have been created" | tee log.txt
fi
if [[ -z `cat /etc/group | grep oinstall` ]]; then
 groupadd oinstall
else
 echo "dba group have been created" | tee log.txt
fi
if [[ -z `id oracle` ]]; then
 useradd -g oinstall -G dba oracle
else
 echo "user oracle have been created" | tee log.txt
fi
chown -R oracle:oinstall /u01
chmod -R 755 /u01

echo "**************************kernel parameter**********************************"
cat >>/etc/sysctl.conf<fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
EOF
/sbin/sysctl -p
echo "change User limts"
cat >>/etc/security/limits.conf<oracle           soft    nproc   2047
oracle           hard    nproc   16384
oracle           soft    nofile  1024
oracle           hard    nofile  65536
EOF
cat >>/etc/pam.d/login<session    required     pam_limits.so
EOF
cat >>/etc/profile<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 >>/home/oracle/.bash_profile<export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
EOF

su - oracle<source ~/.bash_profile
/installationMedias/database/runInstaller
EOF


分享标题:写的一个oracle安装前的准备的脚本,大家可以拿去修改修改使用
网页URL:http://myzitong.com/article/gcsjhd.html