当前位置: 主页 > 操作系统 > Linux > linux下实现自动安装Oracle

linux下实现自动安装Oracle

时间:2009-12-22来源:互联网 点击:

read -p "Please input rlwrap path:" rlpath

read -p "Please input the path of CD:" cdpath
until [ -e "$cdpath"/Server ] #Make sure the path that you given is right.
do
read -p "Wrong path of CD,please retry:" cdpath
done

read -p "Please input your oracle tar.gz package name(include path) :" opackage

if [ ! -f "$opackage" ]
then
echo "The package is wrong!"
exit 1
fi

{
groupadd oinstall
groupadd dba
useradd -m -g oinstall -G dba $oname
mkdir -p /u01/app/$oname
chown -R $oname:oinstall /u01/app/$oname
chmod -R 775 /u01/app/$oname
}&>/dev/null

tar -zxf $opackage -C /home/$oname &>/dev/null

until [ "$?" -eq "0" ] #Make sure that the package you given is absolutely right.
do
read -p "Wrong package,please retry:" opachage

tar -zxf $opackage -C /home/$oname &>/dev/null
done

pushd $cdpath/Server &>/dev/null
{
rpm -Uvh compat-db-4*
rpm -Uvh libaio-0*
rpm -Uvh compat-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

站长资讯网
.
分页: [1] [2] [3]
TAG: Linux oracle 自动安装
推荐内容最近更新人气排行
关于我们 | 友情链接 | 网址推荐 | 常用资讯 | 网站地图 | RSS | 留言