189 8069 5689

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

#!/bin/bash

成都创新互联公司长期为上1000+客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为惠济企业提供专业的网站设计、网站制作惠济网站改版等技术服务。拥有十余年丰富建站经验和众多成功案例,为您定制开发。

# 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

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站标题:写的一个oracle安装前的准备的脚本,大家可以拿去修改修改使用-创新互联
网站网址:http://cdxtjz.cn/article/cedcgc.html

其他资讯