Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2800331
  • 博文数量: 389
  • 博客积分: 4177
  • 博客等级: 上校
  • 技术积分: 4773
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-16 23:29
文章分类

全部博文(389)

分类: Oracle

2014-10-17 20:24:04

                                 ORACLE安装预设置脚本

        对于DBA来说,经常需要不断去部署oracle database软件,设置一些环境变量或是系统
参数感觉十分枯燥,通过脚本来实现可以减少很多重复的工作.


#!/bin/bash

#writen by dongdongtang
#purpose: install oracle database software

#modify sid by yourself
SID=test

export PATH=/usr/bin:/usr/sbin:/bin:/sbin

echo "kernel.shmmax = 6294967296" >>/etc/sysctl.conf
echo "kernel.shmmni = 4096" >>/etc/sysctl.conf
echo "kernel.shmall = 2097152" >>/etc/sysctl.conf
echo "kernel.sem = 250 32000 100 142" >>/etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 1024 65000"  >>/etc/sysctl.conf
echo "fs.aio-max-nr" = 3145728" >>/etc/sysctl.conf
echo "fs.file-max" = 6815744" >>/etc/sysctl.conf
echo "net.core.rmem_default = 4194304" >>/etc/sysctl.conf
echo "net.core.rmem_max = 4194304"  >>/etc/sysctl.conf
echo "net.core.wmem_default = 262144" >>/etc/sysctl.conf
echo "net.core.wmem_max = 1048586" >>/etc/sysctl.conf

#reload kernel settings
sysctl -p

echo "oracle soft nofile 600000" >>/etc/security/limits.conf
echo "oracle hard nofile 600000" >>/etc/security/limits.conf
echo "oracle soft noproc 16384"  >>/etc/security/limits.conf
echo "oracle soft noproc 16384"  >>/etc/security/limits.conf

service iptables stop

sed -i 's/SELINUX=permissive/SELINUX=disabled/' /etc/sysconfig/selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux


yum install binutils* -y
yum install compat-libstdc++* -y
yum install gcc-* -y
yum install gcc-c++* -y
yum install glibc* -y
yum install glibc* -y
yum install glibc* -y
yum install ksh
yum install  libaio* -y
yum install  libaio* -y
yum install  libgcc* -y
yum install  libstdc* -y
yum install  libstdc++-devel* -y
yum install  libXext* -y
yum install libXtst* -y
yum install libX11* -y
yum install libXau* -y
yum install libXi* -y
yum install make* -y
yum install  sysstat* -y

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle


mkdir -p /u01/app/oracle/product/12.1.0.1/db_1

chown -R oracle:oinstall /u01

echo  "export ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile
echo  "export ORACLE_HOME=/u01/app/oracle/product/12.1.0.1/db_1" >> /home/oracle/.bash_profile
echo "export ORACLE_SID=${SID}" >> /home/oracle/.bash_profile
echo "export PATH=$PATH:$ORACLE_HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin" >> /home/oracle/.bash_profile


部分的设置需要视具体环境而调整.

阅读(2355) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~