function addoralceuser
{
groupadd -g 1500 oinstall
#if [ $? -ne 0 ]; then
# echo "add oinstall group failed."
# return 1
#fi
groupadd -g 1501 dba
#if [ $? -ne 0 ]; then
# echo "add dba group failed."
#fi
id ${USERNAME} > /dev/null 2<&1
if [ $? -ne 0 ] ; then
echo "user ${USERNAME} not exist, now creating ${USERNAME}..."
useradd -d /home/oracle -g oinstall -G dba -m -u 200 oracle
if [ $? -ne 0 ] ; then
echo "create user ${USERNAME} failed!"
return 1
else
echo "create user ${USERNAME} succeed!"
fi
else
echo "user ${USERNAME} already exist! continue to install..."
fi
echo "setting password for user ${USERNAME}..."
echo "$USERNAME:$USERPASSWD" | chpasswd
if [ $? -ne 0 ] ; then
echo "set password for user ${USERNAME} failed!"
return 1
else
echo "set password for user ${USERNAME} succeed!"
fi
return 0
}
suse 安装Oracle数据库——addoralceuser
最新推荐文章于 2022-09-29 15:44:43 发布