break
fi
done
################################################################################
####
#obtain hostname
################################################################################
####
sname=$(hostname) #get hostname
[ -z ${sname} ]&& echo -e 'shell can not obtain ${c_red}hostname${c_end},shell
interrupt forcedly'&&exit 1
################################################################################
####
#obtain ORACLE_BASE ORACLE_HOME
################################################################################
####
orabase="${basedir}/oracle" #set path of oracle_base
orahome="${orabase}/product/11.2.0.4/dbhome_1" #set path of oracle_home
#orahome="${basedir}/product/11.2.0.4/dbhome_1" #set path of oracle_home
################################################################################
####
#obtain ORACLE_SID
################################################################################
####
read -p "`echo -e "please enter the sid.default [${c_yellow}orcl${c_end}]: "`"
osid
orasid=${osid:-orcl} #set value of oracle_sid
################################################################################
####
#obtain the momery percentage of the oracle using server momery
################################################################################
####
while true
do
read -p "`echo -e "Please enter the momery percentage of the oracle using
server momery.default [${c_yellow}60${c_end}]: "`" mper
perusemom=${mper:-60}
if [ -n "`echo ${perusemom} | sed 's/[0-9]//g' | sed 's/-//g'`" ];then
echo -e "please enter ${c_red}exact number${c_end}"
continue
else
[ "${perusemom}" -ge "90" ]&& echo -e "the percentage can not be greater than
${c_red}90${c_end}"&& continue
break
fi
done
################################################################################
####
#obtain current day
################################################################################
####
daytime=`date +%Y%m%d`
################################################################################
####
#stop firefall and disable selinux
################################################################################
####
systemctl stop firewalld
systemctl disable firewalld
/usr/sbin/setenforce 0
cp /etc/selinux/config /etc/selinux/config.$(date +%F)
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
评论