Oracle

oracle数据库安装预环境一键处理脚本

日期:2015/6/28来源: IT猫扑网

  #!/bin/bash

  #增加安装oracle所需的用户和组

  groupadd oinstall

  groupadd dba

  useradd -g oinstall -G dba -d /home/oracle -m oracle

  #创建安装Oracle所需的目录

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

  chmod -R 775 /u01

  chown -R oracle:oinstall /u01

  #改变Oracle参数

  echo "kernel.shmmni = 4096" >> /etc/sysctl.conf

  echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf

  echo "fs.file-max = 65536" >> /etc/sysctl.conf

  echo "net.ipv4.ip_local_port_range = 1024 65000" >> /etc/sysctl.conf

  echo "net.core.rmem_default=262144" >> /etc/sysctl.conf

  echo "net.core.rmem_max=262144" >> /etc/sysctl.conf

  echo "net.core.wmem_default=262144" >> /etc/sysctl.conf

  echo "net.core.wmem_max=262144" >> /etc/sysctl.conf

  /sbin/sysctl -p

  #设置Oracle环境变量

  echo "ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile

  echo "ORACLE_HOME=\$ORACLE_BASE/product/10.2.0/db_1" >> /home/oracle/.bash_profile

  echo "ORACLE_SID=cmtest" >> /home/oracle/.bash_profile

  echo "PATH=\$PATH:\$HOME/bin:\$ORACLE_HOME/bin" >> /home/oracle/.bash_profile

  echo "LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/usr/lib" >> /home/oracle/.bash_profile

  echo "export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH" >> /home/oracle/.bash_profile

  source /home/oracle/.bash_profile

  #设置Oracle用户shell limit

  echo "oracle soft nproc 2047" >> /etc/security/limits.conf

  echo "oracle hard nproc 16384" >> /etc/security/limits.conf

  echo "oracle soft nofile 1024" >> /etc/security/limits.conf

  echo "oracle hard nofile 65536" >> /etc/security/limits.conf

  #修改Linux版本号

  cp /etc/redhat-release /etc/redhat-release.`date -I`.bak

  echo "redhat-4" > /etc/redhat-release

  #修改/etc/hosts文件

  cp /etc/hosts /etc/hosts.`date -I`.bak

  echo "# Do not remove the following line, or various programs" > /etc/hosts

  echo "# that require network functionality will fail." >> /etc/hosts

  echo "`ifconfig eth0 |grep "inet addr" |cut -d: -f2 |cut -d" " -f1`  `more /etc/sysconfig/network | grep HOSTNAME | cut -c10-`  localhost" >> /etc/hosts

  echo "127.0.0.1 `more /etc/sysconfig/network | grep HOSTNAME | cut -c10-`" >> /etc/hosts

  #yum安装必要包

  yum -y install setarch-2*  make-3*  glibc-2*  libaio-0*  compat-libstdc++-33-3*  compat-gcc-34-3*  compat-gcc-34-c++-3*  gcc-4*  libXp-1*  openmotif-2*  compat-db-4*

相关文章

相关下载

网友评论

我要评论...
    没有更早的评论了
    取消