暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
Linux系统一键安装oracle11g
308
9页
4次
2022-09-06
10墨值下载
#!/bin/bash
#by xie
#v0.3
################################################################################
#
#before the bash you must install necessary rpm for oracle and edit hostname
#
################################################################################
#
echo "please confirm that you have put the script and software into the base
dir"
echo "please confirm that server can connect to internet"
c_yellow="\e[1;33m"
c_red="\e[1;31m"
c_end="\e[0m"
################################################################################
####
#obtain ip
################################################################################
####
echo " "
echo "internet name:"
for i in `ip addr | egrep "^[0-9]" | awk -F ':' '{print $2}'`
do
echo -e " \e[1;33m"$i": "`ifconfig $i | egrep -v "inet6" | awk -F 'net|netmaskt'
'{print $2}' | sed ':label;N;s/\n//;b label' | sed -e 's/ //g' -e
's/)//g'`"\e[0m"
#echo -e " \e[1;33m"$i": "`ifconfig $i | egrep -v "inet6" |grep "inet addr:" |
awk -F ":" '{print $2}'|awk -F ' ' '{print $1}'` "\e[0m"
done
while true
do
#read -p "please enter the name of Ethernet,default [eth0]:" eth
read -p "`echo -e "please enter the name of Ethernet,default [${c_yellow}lo$
{c_end}]: "`" eth
#get ip #ifconfig ${eth:-eth0} 2> /dev/null | grep -Po '(?<=inet addr:)[\d\.]+'
ipaddr=`ifconfig ${eth:-lo} 2> /dev/null | egrep -v "inet6" | awk -F'inet|
netmask' '{print $2}' | sed ':label;N;s/\n//;b label' | sed 's/ //g'`
[ $? != 0 ]&& echo -e "pleas input the ${c_red}exact name of Ethernet${c_end}"&&
continue
if [ -n "$(echo ${ipaddr} | sed 's/[0-9]//g' | sed 's/.//g')" ];then
echo -e 'shell can not obtain ip,pleas input the ${c_red}exact name of Ethernet$
{c_end}'
continue
else
break
fi
done
################################################################################
####
#obtain base dir
################################################################################
####
while true
do
read -p "`echo -e "please enter the name of base dir,put this shell and
software in the dir.default [${c_yellow}/u01/app${c_end}]: "`" bdir
basedir=${bdir:-/u01/app} #this is base dir,put this shell and software in the
dir
if [ ! -d ${basedir} ];then
echo -e "the ${basedir} is not exsist,please ${c_red}make it up${c_end}"
continue
else
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
of 9
10墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜