zoukankan      html  css  js  c++  java
  • 红帽安装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 
    
    kernel.shmmax = 2147483648 
    
    kernel.shmmni = 4096 
    
    kernel.sem = 250 32000 100 128 
    
    fs.file-max = 65536 
    
    net.ipv4.ip_local_port_range = 1024 65000 
    
    net.core.rmem_default = 1048576 
    
    net.core.rmem_max = 1048576 
    
    net.core.wmem_default = 262144 
    
    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 
    
    oracle hard nproc 16384 
    
    oracle soft nofile 1024 
    
    oracle hard nofile 65536 
    " >> /etc/security/limits.conf
    echo "Please make sure your hostname and host file configure ok."
  • 相关阅读:
    VB与SQL Server实现文件上传下载
    rszl数据表和crjsj数据表的关联查询
    网吧忘关QQ的后果
    走 近 WSH
    形容长得丑的30句经典句子
    关机VBS脚本
    C51单片机中断定义
    .NET架构的核心技术
    SQL SERVER的命令行工具Osql的用法
    七七情人节
  • 原文地址:https://www.cnblogs.com/snaid/p/3407676.html
Copyright © 2011-2022 走看看