红帽安装oracle 10g系统环境配置脚本

redhat linux安装oracle之前需要配置一些系统环境,每次配置比较麻烦,为方便,写了个简单的脚本,在rhel5.8系统测试通过。

内核参数根据实际内存大小调整

#!/bin/bash
################################################################################
# Description:此脚本为rhel5或rhel6环境安装oracle 10g的系统准备工作,需要配置好yum源
# 添加的oracle用户默认密码为oracle
# Author:snaid
# Email:snaid_x@163.com
################################################################################
#difine oracle_sid
read -p "Please input your oracle sid that will be install:" ora_sid
#modify system version
echo "Red Hat Enterprise Linux Server release 4.8 (Tikanga)" > /etc/redhat-release
#install depdent packge
for i in binutils compat-gcc-34 compat-libstdc++-296 control-center gcc gcc-c++ \
glibc glibc-common glibc-devel libaio libgcc libstdc++ libstdc++-devel libXp \
make openmotif22 setarch
do
yum -y install $i 2>/dev/null ;
done
#modify kernel parameter
printf "kernel.shmall = 2097152 \n
kernel.shmmax = 2147483648 \n
kernel.shmmni = 4096 \n
kernel.sem = 250 32000 100 128 \n
fs.file-max = 65536 \n
net.ipv4.ip_local_port_range = 1024 65000 \n
net.core.rmem_default = 1048576 \n
net.core.rmem_max = 1048576 \n
net.core.wmem_default = 262144 \n
net.core.wmem_max = 262144 ">> /etc/sysctl.conf
/sbin/sysctl -p
#adduser
/usr/sbin/groupadd -g 1000 oinstall
/usr/sbin/groupadd -g 1001 dba
/usr/sbin/useradd -u 1000 -g oinstall -G dba oracle
echo "oracle"| passwd oracle --stdin > /dev/null 2>&1
#build oracle directory
mkdir -p /u01/oracle
chown -R oracle.oinstall /u01
#oracle environment variable
echo export ORACLE_BASE=/u01/oracle >> /home/oracle/.bash_profile
echo export ORACLE_HOME=\$ORACLE_BASE/product/10.2.0 >> /home/oracle/.bash_profile
echo export ORACLE_SID=$ora_sid >> /home/oracle/.bash_profile
echo export PATH=\$PATH:\$HOME/bin:\$ORACLE_HOME/bin >> /home/oracle/.bash_profile
echo export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib >> /home/oracle/.bash_profile
source /home/oracle/.bash_profile
#oracle's ulimit
printf
"oracle soft nproc 2047 \n
oracle hard nproc 16384 \n
oracle soft nofile 1024 \n
oracle hard nofile 65536 \n" >> /etc/security/limits.conf
echo "Please make sure your hostname and host file configure ok."

 

posted on 2013-11-04 23:18  woodyx  阅读(210)  评论(0编辑  收藏  举报

导航