环境:redhat5.5,oracle10g

以下是安装脚本部分
-----------------------------------------------------------------------------------------------
echo "#########################################"
echo "## ##"
echo "## install oracle_10g at redhat5.5 ##"
echo "## by_di0ye ##"
echo "#########################################"
rhi="/media/redhat5.5"
tar="/tmp"
mkdir -p $rhi
umount /dev/cdrom
mount /dev/cdrom $rhi
cd $rhi/Server
echo "################pwd######################"
pwd
echo "################rpm######################"
rpm -ivh setarch-2*
rpm -ivh make-3*
rpm -ivh glibc-2*
rpm -ivh libaio-0*
rpm -ivh compat-libstdc++-33-3*
rpm -ivh compat-gcc-34-3*
rpm -ivh compat-gcc-34-c++-3*
rpm -ivh gcc-4*
rpm -ivh libXp-1*
rpm -ivh openmotif-2*
rpm -ivh compat-db-4*
echo "################release##################"
echo "redhat-4" > /etc/redhat-release
cat /etc/redhat-release
echo "################kernel###################"
echo "kernel.shmall = 2097152
kernel.shmmax = 2147483648
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" >> /etc/sysctl.conf
/sbin/sysctl -p
echo "################user#####################"
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo "123456" | passwd --stdin oracle
echo "################dir#####################"
mkdir -p /home/app/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /home/app/
chmod -R 777 /home/app/
echo "################shell###################"
echo "oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536" >> /etc/security/limits.conf
echo "################login###################"
echo "session required /lib/security/pam_limits.so" >> /etc/pam.d/login
echo "################bash####################"
echo "# Oracle Settings
ORACLE_BASE=/home/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=$PATH:$ORACLE_HOME/bin; export PATH
CLASSPATH=$ORACLE_HOME/JREORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
DISPLAY=192.168.6.190:0.0; export DISPLAY
LANG=en_US; export LANG" >> /home/oracle/.bash_profile
echo "################tar#####################"
mkdir $tar/Oracle-10g-linux
tar -xvf $tar/Oracle-10g-linux.tar.gz -C $tar/Oracle-10g-linux/
echo "################xhost###################"
xhost local:oracle non-network local connections being added to access control list
echo "################end#####################"
-------------------------------------------------------------------------------------------------------------------------------------------
问题一:定义变量
        rhi="/media/redhat5.5" 

问题二:替换文件内容
        echo "redhat-4" > /etc/redhat-release 

问题三:追加文件内容
        echo "redhat-4" >> /etc/redhat-release 

问题四:创建用户并自动添加密码
        useradd -g oinstall -G dba oracle
        echo "123456" | passwd --stdin oracle

问题五:环境变量DISPLAY
        DISPLAY=192.168.6.190:0.0; export DISPLAY 

问题六:解决同一台机器的不同用户访问X的问题
        xhost local:oracle non-network local connections being added to access control list
 
问题七:报错OUI-10058
        另外打开一个终端,SU到ROOT用户,然后执行/opt/oracle/oraInventory/orainstRoot.sh 文件,执行完毕之后,在之前安装的窗口选择继续。