用shell脚本配置Oracle安装需求
1.配置好yum
yum -y install libXp
yum -y install libaio
2.按照自己的需求修改chprofile文件内的SID
3.rpm -ivh rlwrap-0.30-1.el5.i386.rpm
4.执行脚本 #install目录下存放了一下脚本:adduser.sh、chprofile.sh、install.sh、limits.sh、mkdir.sh、sysctl.sh
./install
adduser脚本内容
#/bin/bash
ADDGROUPS="oinstall dba"
ADDUSERS="oracle"
for group in $ADDGROUPS ; do
if [ -z "$( awk -F: '{print $1}' /etc/group |grep $group)" ]; then
groupadd $group
echo " Add new group $group"
else
echo " Group $group already existed"
fi
done
for user in $ADDUSERS ; do
if [ -z "$( awk -F: '{print $1}' /etc/passwd |grep $user)" ]; then
useradd $user
echo " Add new user $user"
else
echo " User $user already existed"
fi
done
if $(usermod -g oinstall -G dba oracle) ; then
echo " Modify user oracle account success"
else
echo " Modify user oracle account failure"
fi
chprofile脚本内容
#/bin/bash
PROFILES="/home/oracle/.bashrc"
for PROFILE in $PROFILES ; do
if [ -f "$PROFILE" ] ; then
if [ -z "$(grep "Oracle" $PROFILE)" ] ; then
cat >>$PROFILE >$LIMITS_FILE /proc/sys/kernel/sem
# echo 536870912 > /proc/sys/kernel/shmmax
# echo 4096 > /proc/sys/kernel/shmmni
# echo 2097152 > /proc/sys/kernel/shmall
# echo 65536 > /proc/sys/fs/file-max
# echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
SYSCTL_FILE="/etc/sysctl.conf"
RCLOCAL_FILE="/etc/rc.local"
if [ -f "$SYSCTL_FILE" ] ; then
if [ -z "$(grep "Oracle" $SYSCTL_FILE)" ] ; then
cat >>$SYSCTL_FILE >$RCLOCAL_FILE /proc/sys/kernel/shmmax
echo 4096 > /proc/sys/kernel/shmmni
echo 2097152 > /proc/sys/kernel/shmall
echo 250 32000 100 128 > /proc/sys/kernel/sem
echo 65536 > /proc/sys/fs/file-max
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
END
. $RCLOCAL_FILE
echo " Add Oracle configure kernel parameters success"
else
echo " Oracle configure kernel parameters already existed"
fi
fi
推荐阅读:
CentOS 6.3(x32)下安装Oracle 10g R2
Linux-6-64下安装Oracle 12C笔记