suse 安装Oracle数据库——installoracle

function installoracle
{
echo "begin to install oracle to system..."
if [ ! -f "$SRC_PATH/oracle_install.bin" ]; then
echo "package oracle_install.bin doesn't exist"
return $ERR_DISMISS_PACKAGES
fi

#tar -zxf $SRC_PATH/oracle_install.tar.gz -C /opt > /tmp/oracletar.log 2>&1
chmod 755 $SRC_PATH/oracle_install.bin
$SRC_PATH/oracle_install.bin -o/opt > /tmp/oracletar.log 2>&1
if [ $? -ne 0 ]; then
return 1
fi

chown -R oracle:oinstall /opt/oracle/
chmod -R 775 /opt/oracle/

#修改oracle可执行文件的权限属性
chmod 6751 /opt/oracle/oradb/11g/bin/oracle

return 0
}


function cleanup
{
#TODO:add your owner cleanup code here.
userdel "$USERNAME"
groupdel "oinstall"
groupdel "dba"
rm -fr /opt/oracle/
return 0
}


安装:

function installpackage
{

#TODO: add your owner install script here.
if [ "`whoami`" != "root" ]; then
echo "Please use root user to execute the script.";
return 1
fi

addoralceuser
if [ $? -ne 0 ] ; then
echo "add oracle user failed."
return 1
fi

setupsysctl
if [ $? -ne 0 ] ; then
echo "set sysctl parameter failed."
return 1
fi

setupenviroment
if [ $? -ne 0 ] ; then
echo "set enviroment failed."
return 1
fi

installoracle
if [ $? -ne 0 ] ; then
echo "install oracle to system failed.."
return 1
fi

return 0
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值