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
}