Skip to content
Học Công nghệ Thông tin thực chiếnHọc Công nghệ Thông tin thực chiến
  • KHÓA HỌC
  • KIẾN THỨC
  • KÊNH YOUTUBE
  • NGƯỜI SÁNG LẬP
Học Công nghệ Thông tin thực chiếnHọc Công nghệ Thông tin thực chiến
  • KHÓA HỌC
  • KIẾN THỨC
  • KÊNH YOUTUBE
  • NGƯỜI SÁNG LẬP
Oracle DBA

Oracle 18c có còn cung cấp Bash script tính số trang nhớ bự Hugepages không?

  • 13 May, 2025
  • Com 0

Phiên bản Oracle 12c thì Oracle vẫn cung cấp miễn phí Bash script tên là hugepages_settings.sh để tính số trang nhớ Hugepages cần cấp phát cho Oracle database chạy cơ chế bộ nhớ là ASMM.

Nhưng từ phiên bản Oracle 18c thì Bash script này không còn miễn phí nữa mà bạn phải mua thuê bao kĩ thuật của Oracle mới có.

hugepages_settings.sh nằm trong My Oracle Support note 401749.1.

Tôi tìm trên mạng thì thấy nó có nội dung như sau:

#!/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 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 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 the overall 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.%d\n",$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.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" ;;
    '4.14') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    '4.18') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    '5.4') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    *) echo "Kernel version $KERN is not supported by this script (yet). Exiting." ;;
esac
Tags:
Linux hugepagesOracle 18c HugepagesOracle database 18cOracle Doc ID 401749.1Oracle Subscription AccountOracle Support AccountOracle Support note 401749.1
Share on:
Tính số Hugepages cấp cho Oracle 12c trên RHEL 7
Hugepages 1 GB thì Oracle 21c có xài được không?

Search

Categories

  • An toàn thông tin thực chiến (6)
  • Cơ sở dữ liệu thực chiến (6)
  • Công nghệ ảo hóa máy chủ (1)
  • Công nghệ lõi Công nghệ Thông tin (1)
  • Công nghệ lõi Linux (7)
  • Công nghệ phần mềm thực chiến (7)
  • Đại số tổ hợp (1)
  • DevOps thực chiến (2)
  • Điện toán đám mây thực chiến (3)
  • Docker container (3)
  • Giải tích tổ hợp (1)
  • Hệ điều hành Linux thực chiến (5)
  • Học công nghệ thông tin thực chiến (1)
  • Lập trình thực chiến (1)
  • Linux thực chiến (2)
  • Olympic Toán 30 tháng 4 (1)
  • Oracle DBA (5)
  • Podman container (3)
  • Tích hợp hệ thống công nghệ thông tin thực chiến (1)

Tags

Biên dịch Linux kernel (4) Biên dịch nhân Linux (4) Cloud compting (2) Container-Optimized OS (2) Container Operating System (4) Container OS (4) Công nghệ lõi Linux (3) Công nghệ phần mềm thực chiến (3) Fedora CoreOS (3) Giao thức SMB (2) Hệ điều hành Linux thực chiến (4) Học an toàn thông tin (2) initramfs (2) Linux hugepages (3) Linux kernel (3) Linux kernel compile (2) Linux kernel module (2) Linux security (3) Lập trình MySQL (2) Lập trình MySQL thực chiến (2) MySQL 8.0 LTS (1) MySQL 8.4 LTS (1) MySQL 9 IR (1) MySQL database developer (3) MySQL DBA (3) MySQL thực chiến (1) Máy ảo Linux (2) netplan (3) Oracle database 12c (2) Quản trị MySQL (3) Samba Active Directory Domain Controller (4) Samba AD DC (5) Samba AD Domain Controller (5) SMB protocol (3) Thuật toán băm mật khẩu (2) Trung tâm dữ liệu (2) Tối ưu cơ sở dữ liệu MySQL (4) Tối ưu Linux server (2) Tối ưu MySQL (4) Ubuntu netplan (3) Ubuntu netplan yaml (2) vmlinux (2) vmlinuz (3) VMware Workstation (2) Điện toán đám mây (3)

Học Công nghệ Thông tin chuyên sâu
Tiết kiệm tiền bạc, thời gian, công sức cho người học
© Copyright 2024 CâyTreOS – Học IT thế kỉ 21

Học Công nghệ Thông tin thực chiếnHọc Công nghệ Thông tin thực chiến