快速业务通道

shell脚本实现linux下自动安装Oracle10g

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-28
mpat-libstdc -33-3*
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c -3*
rpm -Uvh libXp-1*
rpm -Uvh openmotif-2*
rpm -Uvh gcc-4*
}&>/dev/null
#rpm -Uvh glibc-2.5-12.i686.rpm
popd &>/dev/null

flag=0
{
pushd $rlpath
$rlpath/configure
make && make install
popd
}&>/dev/null

if [ "$?" -eq "1" ] #Be used for judging if rlwrap was compiled successfully.
then
flag=1
fi

grep ''fs.file-max'' /etc/sysctl.conf &>/dev/null
if [ "$?" -eq "1" ] #Make jugdement if the configure file was already configured.
then

sed -i ''/^kernel.shmmax/d'' /etc/sysctl.conf #Delete the argument "kernerl.shmmax" in the configure file.
sed -i ''/^kernel.shmall/d'' /etc/sysctl.conf #Delete the argument "kernel.shmall" in the configure file

cat >> /etc/sysctl.conf <<EOF
kernel.shmall = 2097152
kernel.shmmax = $shmmax
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=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
#signaturelevin
EOF
fi

sysctl -p &>/dev/null #Make the configured file come into effect immediately.

grep ''soft nproc'' /etc/security/limits.conf &>/dev/null
if [ "$?" -eq "1" ]
then
cat >> /etc/security/limits.conf <<EOF
soft nproc 2047
hard nproc 16384
soft nofile 1024
hard nofile 65536
#signaturelevin
EOF
fi

grep ''pam_limits.so'' /etc/pam.d/login &>/dev/null
if [ "$?" -eq "1" ]
then
cat >> /etc/pam.d/login <<EOF
session required pam_limits.so
#signaturelevin
EOF
fi

grep ''ORACLE_SID=orcl'' /home/$oname/.bash_profile &>/dev/null
if [ "$?" -eq "1" ]
then
cat >>/home/$oname/.bash_profile <<EOF
export TMP=/tmp
export ORACLE_BASE=/u01/app/$oname
export ORACLE_HOME=$ORACLE_BASE/product/10g
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
alias fox="firefox"
#signaturelevin
EOF
fi

. /home/$oname/.bash_profile

sed -i ''s/5/4/'' /etc/redhat-release #Resovling the problems brought by the version of your system.

xhost &>/dev/null

echo -e "a"
if [ "$flag" -eq "1" ]
then
echo -e "Configure successful but the rlwrap was not compiled successfully.You should compile it by your own after finishing installs of oracle10g.Now,the following steps are your own work.n n 1.export LANG=C n 2.cd database/n 3../runInstallern 4.Configure according to the Oracle GUI information.n"
else
echo -e "Configure successful!The following steps are your own work.Just do it.n n 1.export LANG=C n 2.cd database/n 3../runInstallern 4.Configure according to the Oracle GUI information.n"
fi

su - $oname

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号