本脚本所做的事情并不是完全的安装好ORCLE,那也是不可能的事情,因为ORACLE安装的后期是有图形界面的交互模式,所以本脚本所做的只是前期环境配置,但就是这些前期配置才是最耗时的,所以写成脚本很必要。
本脚本只在RHEL5U3上做过测试,可以正常使用,对于其他版本有待验证和完善。
#This program is used for helping you install oracle10g automatically.
#Be used in Redhat 5 enterprise.
#Statment:Before installing oracle10g by this program,you should prepare oracle10g tar.gz file, rlwrap and redhat install CD path.If you have any question about this program,you could contact me by the following email address.
#Author:Levin Wong<findingcc@126.com>
#Written on xxxx
trap ‘echo;exit 0;‘ 2 #Set trap,so you can interrupt the program when it is running.
shmmax=$(($(free |awk ‘NR==2{print $2}‘)*1024/2)) #Set the argument "shmmax" according to the memory size of your computer.
read -p "Please input the oracle username that you want to create:" ooname
read -p "Please verify the oracle username:" oname
until [ ! -z "$oname" ] #Make judgment about if the variable $oname you given is null.
do
read -p "Please verify the oracle username:" oname
done
username=$(awk -F: ‘{print $1}‘ /etc/passwd)
for i in $username #Judge about if $oname already exists in your system.
do
if [ $oname = $i ]
then
echo "Error!The username you input is already exists in your system."; exit 1
fi
done
until [ ${oname}x = ${ooname}x ] #Make sure that the input is the very one which you want.
do
read -p "Please input the oracle username that you want to create:" ooname
read -p "Please verify the oracle username:" oname
if [ -z "$oname" ] #If $oname is still null,then exit this program.
then
echo "Error!"
exit 1
fi
done
分页: [1] [2] [3]
TAG: Linux oracle 自动安装