当前位置:  数据库>oracle

在Oracle 11.2.0.3.0上开启大页(hugepages)的详细解析

    来源: 互联网  发布时间:2017-06-01

    本文导语: 什么时侯使用大页呢,当你主机的物理内存为64G,设SGA>=32G时,建议开启大页,步骤如下: 1、 关闭Oracle Database 11g中的AMM(Automatic Memory Management),即把两个参数MEMORY_TARGET / MEMORY_MAX_TARGET设为0 如果设考数 MEMORY_MAX_TARGET为0不成功,...

什么时侯使用大页呢,当你主机的物理内存为64G,设SGA>=32G时,建议开启大页,步骤如下:

1、 关闭Oracle Database 11g中的AMM(Automatic Memory Management),即把两个参数MEMORY_TARGET / MEMORY_MAX_TARGET设为0

如果设考数 MEMORY_MAX_TARGET为0不成功,那么请考参

gyj@OCM> show parameter memory_max_target

NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_max_target                    big integer 0
gyj@OCM> show parameter memory_target

NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_target                        big integer 0


[oracle@mydb admin]$ vi /u01/app/oracle/product/11.2.0/rdbms/admin/hugepages_settings.sh

#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
#
# 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 text
echo "
This script is provided by Doc ID 401749.1 from My Oracle Support
(http://support.oracle.com) where it is intended to compute values for
the recommended HugePages/HugeTLB configuration for the current shared
memory segments. 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 -m


Press Enter to proceed..."

read

# Check for the kernel version
KERN=`uname -r | awk -F. '{ printf("%d.%dn",$1,$2); }'`

# Find out the HugePage size
HPG_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 1
fi

# Initialize the counter
NUM_PG=0

# Cumulative number of pages required to handle the running shared memory segments
for 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`
    fi
done

RES_BYTES=`echo "$NUM_PG * $HPG_SZ * 1024" | bc -q`

# An SGA less than 100MB does not make sense
# Bail out if that is the case
if [ $RES_BYTES -lt 100000000 ]; then
    echo "***********"
    echo "** ERROR **"
    echo "***********"
    echo "Sorry! There are not enough total of shared memory segments allocated for
HugePages configuration. HugePages can only be used for shared memory segments
that you can list by command:

    # ipcs -m

of 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 1
fi

# Finish with results
case $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" ;;
esac

# End


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • linux下oracle的自启动脚本解析
  • oracle SQL解析步骤小结
  • 解析mysql与Oracle update的区别
  • 细化解析Oracle 10g STATSPACK的新功能
  • 深入解析Oracle参数及参数文件
  • Oracle数据库安装配置流程示例详细解析
  • Oracle中DBMS_SQL解析SQL语句的流程
  • [Oracle] RAC 之 - 负载均衡深入解析
  • Oracle数据库安全性管理基本措施实例解析
  • 解析Oracle查询和删除JOB的SQL
  • 解析jdbc处理oracle的clob字段的详解
  • 职场专家解析Oracle认证门道
  • oracle 索引不能使用深入解析
  • oracle的rownum深入解析
  • 解析如何查看Oracle数据库中某张表的字段个数
  • Oracle row_number() over()解析函数高效实现分页
  • 解析学习Oracle架构所应了解的基础知识
  • Oracle基本查询过滤排序示例解析
  • Oracle硬解析和软解析的区别分析
  • 解析Oracle中多表级联删除的方法
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 移动开发 iis7站长之家
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,