ITPub博客

首页 > 数据库 > Oracle > Linux环境安装Oracle11g(二)——操作系统参数及服务调整

Linux环境安装Oracle11g(二)——操作系统参数及服务调整

原创 Oracle 作者:zhcunique 时间:2021-02-04 14:29:32 0 删除 编辑

三、调整操作系统相应服务和参数

  1. 禁用 SELINUX
    setenforce 0
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    getenforce
    修改为 DISABLE

  2. 关闭Transparent HugePages
    修改/etc/grub.conf文件,在Kernel行末尾加上下列参数:
    transparent_hugepage=never

  3. IO调度算法调整
    修改/etc/grub.conf文件,在Kernel行末尾加上下列参数:
    elevator=deadline
    可以通过cat /sys/block/sda/queue/scheduler命令来查看目前调度算法。

  4. 配置服务
    service iptables stop
    service iptables save
    service ip6tables stop
    service ip6tables save
    chkconfig avahi-daemon off
    chkconfig bluetooth off
    chkconfig cpuspeed off
    chkconfig cups off
    chkconfig firstboot off
    chkconfig ip6tables off
    chkconfig iptables off
    chkconfig pcmcia off

  5. 内核参数修改
    cat>>/etc/sysctl.conf<<EOF
    kernel.shmmax = 54050481766
    kernel.shmall = 16494898
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 6815744
    fs.aio-max-nr = 4194304
    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 = 1048576
    net.ipv4.ipfrag_high_thresh = 16777216
    net.ipv4.ipfrag_low_thresh = 15728640
    kernel.randomize_va_space=0
    vm.min_free_kbytes = 524288
    # vm.nr_hugepages = 512
    EOF
    最佳配置算法:
    #shmmax
    echo "`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'` * 1024 * 0.8" | bc  | sed 's#\..*$##'
    #shmall
    echo "`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'` / (`getconf PAGESIZE` / 1024)" | bc
    使参数生效
    sysctl -p

  6. Limits配置
    cat>>/etc/security/limits.conf<<EOF
    oracle  soft    nproc           2047
    oracle  hard    nproc           16384
    oracle  soft    nofile          1024
    oracle  hard    nofile          65536
    oracle  soft    stack           10240
    oracle  hard    stack           32768
    root    soft    stack           10240
    root    hard    stack           32768
    *       soft    memlock         unlimited
    *       hard    memlock         unlimited
    EOF

  7. PAM 调整
    echo "session required pam_limits.so" >>/etc/pam.d/login


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69994536/viewspace-2756037/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
先后就职于银行、券商等金融机构科技部门,从事数据库管理、自动化运维管理与系统运维相关工作,拥有Oracle 11g OCM/OCP证书,通过CFA二级考试。

注册时间:2021-02-04

  • 博文量
    73
  • 访问量
    499676