1 配置limits.conf

[oracle@xkan ~]$ free -m             total       used       free     shared    buffers     cachedMem:          5709       2386       3322          1         25        366-/+ buffers/cache:       1994       3715Swap:         5999          0       5999

根据内存大小,我们配置5G到memlock

[root@xkan ~]# grep memlock /etc/security/limits.conf #        - memlock - max locked-in-memory address space (KB)*                   soft    memlock 5242880*                   hard    memlock 5242880

参数生效需要重启

[root@xkan ~]# ulimit -l5242880

2 查看AMM是否关闭

[oracle@xkan ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 14 19:47:34 2017Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> show parameter sgaNAME                                     TYPE         VALUE------------------------------------ ----------- ------------------------------lock_sga                             boolean         FALSEpre_page_sga                             boolean         FALSEsga_max_size                             big integer 1728Msga_target                             big integer 1728MSQL> show parameter pgaNAME                                     TYPE         VALUE------------------------------------ ----------- ------------------------------pga_aggregate_target                     big integer 571MSQL> show parameter memoryNAME                                     TYPE         VALUE------------------------------------ ----------- ------------------------------hi_shared_memory_address             integer         0memory_max_target big integer 0memory_target big integer 0shared_memory_address                     integer         0

3 使用 hugepages_settings.sh 计算 vm.nr_hugepages

需要在所有oracle实例包括ASM实例都启动的情况下进行

[oracle@xkan ~]$ vim hugepages_settings.sh[oracle@xkan ~]$ ./hugepages_settings.sh-bash: ./hugepages_settings.sh: Permission denied[oracle@xkan ~]$ chmod 755 hugepages_settings.sh[oracle@xkan ~]$ ./hugepages_settings.shThis script is provided by Doc ID 401749.1 from My Oracle Support(http://support.oracle.com) where it is intended to compute values forthe recommended HugePages/HugeTLB configuration for the current sharedmemory segments on Oracle Linux. Before proceeding with the execution please note following: * For ASM instance, it needs to configure ASMM instead of AMM. * The 'pga_aggregate_target' is outside the SGA and   you should accommodate this while calculating SGA size. * In case you changes the DB SGA size,   as the new SGA will not fit in the previous HugePages configuration,   it had better disable the whole HugePages,   start the DB with new SGA size and run the script again.And make sure that: * Oracle Database instance(s) are up and running * Oracle Database 11g Automatic Memory Management (AMM) is not setup   (See Doc ID 749851.1) * The shared memory segments can be listed by command:     # ipcs -mPress Enter to proceed...Recommended setting: vm.nr_hugepages = 868

hugapages_settings.sh

[oracle@xkan ~]$ cat hugepages_settings.sh#!/bin/bash## hugepages_settings.sh## Linux bash script to compute values for the# recommended HugePages/HugeTLB configuration# on Oracle Linux## Note: This script does calculation for all shared memory# segments available when the script is run, no matter it# is an Oracle RDBMS shared memory segment or not.## This script is provided by Doc ID 401749.1 from My Oracle Support# http://support.oracle.com# Welcome textecho "This script is provided by Doc ID 401749.1 from My Oracle Support(http://support.oracle.com) where it is intended to compute values forthe recommended HugePages/HugeTLB configuration for the current sharedmemory segments on Oracle Linux. Before proceeding with the execution please note following: * For ASM instance, it needs to configure ASMM instead of AMM. * The 'pga_aggregate_target' is outside the SGA and   you should accommodate this while calculating SGA size. * In case you changes the DB SGA size,   as the new SGA will not fit in the previous HugePages configuration,   it had better disable the whole HugePages,   start the DB with new SGA size and run the script again.And make sure that: * Oracle Database instance(s) are up and running * Oracle Database 11g Automatic Memory Management (AMM) is not setup   (See Doc ID 749851.1) * The shared memory segments can be listed by command:     # ipcs -mPress Enter to proceed..."read# Check for the kernel versionKERN=`uname -r | awk -F. '{ printf("%d.%d/n",$1,$2); }'`# Find out the HugePage sizeHPG_SZ=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`if [ -z "$HPG_SZ" ];then    echo "The hugepages may not be supported in the system where the script is being executed."    exit 1fi# Initialize the counterNUM_PG=0# Cumulative number of pages required to handle the running shared memory segmentsfor SEG_BYTES in `ipcs -m | cut -c44-300 | awk '{print $1}' | grep "[0-9][0-9]*"`do    MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`    if [ $MIN_PG -gt 0 ]; then        NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q`    fidoneRES_BYTES=`echo "$NUM_PG * $HPG_SZ * 1024" | bc -q`# An SGA less than 100MB does not make sense# Bail out if that is the caseif [ $RES_BYTES -lt 100000000 ]; then    echo "***********"    echo "** ERROR **"    echo "***********"    echo "Sorry! There are not enough total of shared memory segments allocated forHugePages configuration. HugePages can only be used for shared memory segmentsthat you can list by command:    # ipcs -mof a size that can match an Oracle Database SGA. Please make sure that: * Oracle Database instance is up and running * Oracle Database 11g Automatic Memory Management (AMM) is not configured"    exit 1fi# Finish with resultscase $KERN in    '2.2') echo "Kernel version $KERN is not supported. Exiting." ;;    '2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;           echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;    '2.6') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;    '3.8') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;    '3.10') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;    '4.1') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;esac# End

4 配置 /etc/sysctl.conf 文件

[root@xkan ~]# vim /etc/sysctl.conf[root@xkan ~]# grep vm.nr_hugepages /etc/sysctl.confvm.nr_hugepages=868

5 重启实例和服务器,检查 hugepage 配置情况

[root@xkan ~]# su - oracle[oracle@xkan ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 14 20:12:59 2017Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@xkan ~]$ lsnrctl stopLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-JUN-2017 20:13:24Copyright (c) 1991, 2013, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))The command completed successfully[oracle@xkan ~]$ exitlogout[root@xkan ~]# reboot[root@xkan ~]# grep HugePages /proc/meminfoAnonHugePages:      8192 kBHugePages_Total:     868HugePages_Free:      868HugePages_Rsvd:        0HugePages_Surp:        0[root@xkan ~]# su - oracle[oracle@xkan ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 14 20:15:30 2017Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to an idle instance.SQL> startupORACLE instance started.Total System Global Area 1803841536 bytesFixed Size                    2254144 bytesVariable Size                  486542016 bytesDatabase Buffers         1308622848 bytesRedo Buffers                    6422528 bytesDatabase mounted.Database opened.SQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@xkan ~]$ grep HugePages /proc/meminfoAnonHugePages:     14336 kBHugePages_Total:     868HugePages_Free:      671HugePages_Rsvd:      668HugePages_Surp:        0[oracle@xkan ~]$

linux hugepages大小,配置Linux服务器 hugepages相关推荐

  1. 阿里云ECS服务器Linux环境下配置php服务器(三)--项目部署篇

    在前两篇里,我们分别介绍了如何购买阿里云服务器,安装基本软件和配置(请看阿里云ECS服务器Linux环境下配置php服务器(一)--基础配置篇) 以及如何安装使用phpMyAdmin(请看阿里云ECS ...

  2. Linux安装和配置sanba服务器,在linux安装配置samba服务器.doc

    在linux安装配置samba服务器 PAGE PAGE 7 在linux上安装配置samba服务器 在linux上安装配置samba服务器 在这给大家介绍一个不错的家伙,samba服务.如果您正在犯 ...

  3. 在红帽Linux上安装samba服务,如何在linux上安装配置samba服务器

    如何在linux上安装配置samba服务器 更新时间:2019-10-29 22:40 最满意答案 1.首先需要登入安装了Linux系统的计算机,安装Samba.Fedora发行版一般使用yum工具安 ...

  4. Linux(Redhat5.5)配置时间服务器(Ntp)法

    100为本地时间服务器,其他服务器和100同步.100和网上时间服务器同步 1.首先查询NTP软件版本 rpm -qa|grepntp Redhat5.5自带的就有,如果没有可以从linux安装盘上查 ...

  5. linux 环境下配置ftp服务器

      之前写了 linux 环境下安装和配置mysql数据库以及远程登录,以及linux 环境下配置python虚拟环境,这一篇记录一下 linux系统中如何安装配置 ftp .    安装ftp // ...

  6. linux搭建ldap服务器搭建,Linux下安装配置OpenLDAP服务器

    东西多了,为了好管理,我们会将它们别类:服务器中信息.资源多了,不言而喻也是这个道理,而目录服务器是这个原理.那么支持IPV6协议的OpenLDAP如何在Linux服务器上安装配置? 一.安装Open ...

  7. linux dns已经配置,linux DNS 配置

    在局域网内部通过构建DNS服务器,可以使用户使用域名访问局域网中的每一台计算机.在互联网中,通过DNS服务器,可以使全世界的网络用户使用域名访问各种类型的主机,如WEB服务器.邮件服务器等 而我们使用 ...

  8. linux环境安全配置,Linux系统安全配置方案

    Linux系统安全配置方案 [日期:2006-11-28] 来源: 作者: [字体:大 中 小] 由于Linux的开源,使得Linux强大功能的背后,总是有些不尽人意的地方,为了使Linux达到一个最 ...

  9. 删除linux 软raid0,配置Linux软RAID0

    配置Linux软RAID0 [[email protected] ~]# mdadm -C -v /dev/md0 -l 0 -n 2 /dev/sdb /dev/sdc [[email protec ...

  10. linux 内核配置 dns,Linux的dns配置 - Linux操作系统基础进阶练习题_Linux教程_Linux公社-Linux系统门户网站...

    1.1)查询是否安装DNS软体 1.2)安装bind_chroot 1.3)编辑/etc/sysconfig/named,查看chroot的路径 1.4)注释掉/etc/resolv.conf中其它D ...

最新文章

  1. 银行卡为何要使用ISO8583格式
  2. 代码实现:键盘录入任意一个年份,判断该年是闰年还是平年
  3. 《虚拟化和云计算》实验报告——MININET实践SDN
  4. 我的LINUX学习之路之二十一之web服务器简单搭建
  5. nmap扫描ipv6端口_Flan Scan:Cloudflare开源的轻量级网络漏洞扫描程序
  6. mysql数据库进阶_MYSQL数据库进阶操作
  7. 3D世界相机防抖杆的机制探究
  8. linux innode节点读取,混沌工程之注入磁盘innode耗尽
  9. 吉林大学超星学习通02(2)
  10. Inno Setup 6.0.0+ 繁体中文语言包
  11. 跟着小皮老师了解Go语言LiteIDE详细使用教程❤
  12. wps启用编辑按钮在哪里_wps页面设置在哪里?wps页面设置使用教程
  13. vim 保存出错 E45: readonly option is set (add ! to override)
  14. jquery—addClass方法和removeClass方法
  15. linux上安装NVIDIA显卡驱动以及深度学习需要的cudn、cudnn、pytorch
  16. 论文那些事儿:《Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks》
  17. 2021年,手机拼什么?
  18. excel组合汇总_Excel汇总20140224
  19. 知识图谱常用评价指标:MRR,MR,HITS@K,Recall@K,Precision@K
  20. strchr()函数与strrchr()函数的实现

热门文章

  1. HDU5855 Less Time, More profit(最大权闭合图)
  2. 活动|QuarkChain 高TPS悬赏令:看你能有多快!2.4BTC等你拿!
  3. 人工智能与大数据就业前景_大数据与人工智能方面专业未来前途
  4. 洛谷 P1427 小鱼的数字游戏
  5. PMP 学习笔记 第8章 项目质量管理
  6. python数字转对应中文_python英文数字到中文数字的转换
  7. golang-亚马逊s3上传图片文件
  8. 教你如何设置电脑保护色来保护眼睛
  9. springsecurity实现MD5验证用户登录
  10. RTC风向标:11月最值得关注的26个热点