整个程序代码如下:(问题还没解决)
#! /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@]