Day: July 18, 2011

  • 在CentOS上安装Oracle11g

    1,修改centos 的release文件以便oracle识别,现在好像不改也是可以安装的,并关闭SElinux
    vi /etc/redhat-release
    Red Hat Enterprise Linux AS release 5 (Taroon)
    2,安装没有默认安装的一些包,有些在Oracle安装过程中会提示,但最好先装上。
    yum install binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC-devel -y
    3,创建系统用户:
    /usr/sbin/groupadd oinstall
    /usr/sbin/groupadd dba
    /usr/sbin/useradd -g oinstall -G dba oracle
    passwd oracle
    4,创建数据库安装目录,赋权:
    mkdir -p /home/oracle/product/ //设置oracle的安装目录
    chown -R oracle:oinstall /home/oracle //设置安装目录所属的用户和组
    chmod -R 775 /home/oracle
    5,修改系统参数:
    vi /etc/sysctl.conf
    在最末尾的地方加上:
    kernel.shmall = 2097152 //固定大小为2M
    kernel.shmmax = 2147483648 //一般设置为物理的一半
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default = 4194304
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144

    sysctl -p
    6,修改系统limits.conf文件:
    vi /etc/security/limits.conf 在末尾添加
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
    7,修改login配置
    vi /etc/pam.d/login 在末尾添加
    session required /lib/security/pam_limits.so
    session required pam_limits.so
    8,修改/etc/profile文件,在末尾添加

    if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
    else
    ulimit -u 16384 -n 65536
    fi
    fi

    9,修改Oracle用户的/home/oracle/.bash_profile 注意路径必须和安装目录一样

    # User specific environment and startup programs
    
    PATH=$PATH:$HOME/bin
    
    export PATH
    export ORACLE_BASE=/home/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
    export ORACLE_HOME_LISTNER=$ORACLE_HOME
    export ORACLE_SID=jmj
    export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

    10,解压缩文件,./runInstaller 即可