oracle安裝shell(未驗證)

mrhaozi發表於2009-12-10

整個程式程式碼如下:(問題還沒解決)
#! /bin/bash
groupadd oinstall
groupadd dba
useradd -m -g oinstall -G dba oracle
passwd oracle
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle

ins=$(rpm -q binutils compat-db control-center gcc gcc-c++ glibc-common gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21|awk '{print $2}')
if [ -n "$ins" ]
then
echo "please download and install the following packets:"
echo "$ins"
else
echo "all needed packets have installed"
fi

echo "Oracle 10g required" >> /etc/sysctl.conf
echo "kernel.shmall=2097152" >> /etc/sysctl.conf
echo "kernel.shmmax=536870912" >> /etc/sysctl.conf
echo "kernel.shmmni=4096" >> /etc/sysctl.conf
echo "kernel.sem=25032000100128" >> /etc/sysctl.conf
echo "fs.file-max=65536" >> /etc/sysctl.conf
echo "net.core.rmem_default=262144" >> /etc/sysctl.conf
echo "net.core.wmem_default=262144" >> /etc/sysctl.conf
echo "net.core.rmem_max=262144" >> /etc/sysctl.conf
echo "net.core.wmem_max=262144" >> /etc/sysctl.conf
/sbin/sysctl -p

echo "please type in the ORACLE_SID:"
read sid
echo "export ORACLE_BASE=/oracle" >> /home/oracle/.base_profile
echo "export ORACLE_HOME=oracle/product/10.2.0/db_1" >> /home/oracle/.base_profile
echo "export ORACLE_SID=$sid" >> /home/oracle/.base_profile
echo "export NLS_LANG='simplified chinese'_china.ZHS16GBK" >> /home/oracle/.base_profile
echo "export PATH=$PATH:$ORACLE_HOME/bin" >> /home/oracle/.base_profile
echo "export LANG=zh_CN.GB18030" >> /home/oracle/.base_profile
echo "export EDITOR=vi" >> /home/oracle/.base_profile

path=$(find . -name "runInstaller")
echo $path
if [ -n $path ]
su - oracle -c ./`$path` -silent -responseFile recorded.rsp
./`/oracle/oraInventory/orainsRoot.sh`
./`/oracle/product/10.2.0/db_1/root.sh`
echo “Finish!”

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16396910/viewspace-1029551/,如需轉載,請註明出處,否則將追究法律責任。

相關文章