oracle安装脚本

#!/bin/bash
echo "Set up the installation environment for oracle..."
echo "-------------------------------------------------"
echo "-----------------------------------------"
echo -e "add Users and Groups\n\n"
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle

if [ $? -eq 0 ];then
	echo "-----------------------------------------"
else
	echo "ERROR!!!"
fi

echo "Modify the kernel parameters: /etc/sysctl.conf"
echo "----------------------------------------------"
echo -e "fs.aio-max-nr = 1048576
fs.file-max = 6815744
#kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586">>/etc/sysctl.conf

if [ $? -eq 0 ]; then
	/sbin/sysctl -p
	echo "----Modify done----"
fi

echo "-----------/etc/security/limits.conf------------------"
echo "oracle          soft    nproc  2047
oracle          hard    nproc  16384
oracle          soft    nofile 1024
oracle          hard    nofile 65536
oracle          soft    stack  10240">>/etc/security/limits.conf
if [ $? -eq 0 ];then
	echo "----Modify done----"
fi

echo "-----------/etc/pam.d/login------------------"
echo "session	required	pam_limits.so">>/etc/pam.d/login
if [ $? -eq 0 ];then
        echo "----Modify done----"
fi

echo "-----------/etc/profile------------------"
echo "if [ \$USER = "oracle" ]; then
      if [ \$SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
            ulimit -n 65536
      else
            ulimit -u 16384 -n 65536
      fi
fi">>/etc/profile
if [ $? -eq 0 ];then
        echo "----Modify done----"
fi

echo -e "\n-----------Set Install Directory----------"
mkdir -p /u01
chown -R oracle:oinstall /u01/
chmod -R 775 /u01

echo -e "\n----------Modify .bash_profile-------------"
su - oracle<<EOF
echo "export ORACLE_BASE=/u01/app
export ORACLE_HOME=\\\$ORACLE_BASE/oracle
export ORACLE_SID=orcl
export PATH=\\\$ORACLE_HOME/bin:\\\$PATH:\\\$HOME/bin">>.bash_profile
EOF
echo "----Modify done----"

rpm -q binutils compat-libstdc++-33  elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh  libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel>>/root/need_rpm.log

echo "The Path of rpm needed:/root/need_rpm.log"

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

凤舞飘伶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值